Automatic eMail Obfuscator - E-Mail links are not working

Permalink
I installed the Automatic eMail Obfuscator AddOn, the encryption works but now the mail to links are nor working anymore. Just the browser url ist changing…

http://www.concrete5.org/marketplace/addons/automatic-email-obfusca...

 
Mainio replied on at Permalink Reply
Mainio
Hi there,

You probably have some JavaScript errors on your site that prevent the de-obfuscator from running in the client side.

I'd suggest taking a look at the developer console of your browser to find if there are any JS errors. Then, you'd need to fix those errors to get it running correctly because those errors normally prevent all JS that comes after them from running.

Antti / Mainio
alphaboson replied on at Permalink Reply
Your right there is an JS error, but form this AddOn:

Can't find variable: jQuery in Line 19…

Have You any idea?
I use the current jQuery v1.10.2 and it ist loaded on the page,
my scripts are running perfectly

Regards Marc


[EDID]

I found a dirty fix:
I remove the original code and add this to my other jquery stuff:

$("span.obfuscated_link_text").each(function() {
      if ($(this).hasClass("obfuscated_link")) {
         var href = $(this).attr("href");
         var raw = $('<div/>').html(href).text();
         $(this).attr("href", raw.replace("#MAIL:", "mailto:").replace(/\(at\)/g, "@"));
      } else {
         $(this).html($(this).html().replace("(at)", "@"));
      }
   });
   $("a.obfuscated_link").each(function() {
      if ($(this).hasClass("obfuscated_link")) {
         var href = $(this).attr("href");
         var raw = $('<div/>').html(href).text();
         $(this).attr("href", raw.replace("#MAIL:", "mailto:").replace(/\(at\)/g, "@"));
      } else {


when you have something better … alway :-)
Mainio replied on at Permalink Reply
Mainio
Well, I don't know the exact reason for that since you didn't provide a link to the site but I would guess that you're loading jQuery after you're loading the deobfuscation script.

The deobfuscation script already needs jQuery so it needs to be loaded before that. Of course, it also works if you move that code to another script that gets loaded after jQuery is already available (which I guess you pointed out doing above).
keeasti replied on at Permalink Reply
keeasti
Is it possible that you are loading jQuery in twice?
C5 loads it in anyway (jQuery v1.7.2 I think) and I have a feeling you may be explicitly loading it again. I have done this before without thinking and it can cause all sorts of problems.