How do I create a JavaScript email address?

Nicky

Thanks to LudwigST and dbs !  :-)

— I couldn't get Code to work but Code2 worked instantly !!

— Thanks for the tip about the frontend filter. I had forgotten about that function. I have tried it and it works ok. I haven't used it this time around but I'll keep it in mind for the future.

Regards and thanks again,

:-D

LudwigSt

Quote from: Nicky on May 03, 2020, 06:30:50 PM
a) Instead of a WYSIWYG section is there a way to use a WB CODE section to achieve this?
This should work, or module Code2.
LG Ludwig

Wissen ist Macht - aber nix wissen macht auch nix.

dbs

[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

Nicky

Hello Bakers!

How do I create a JavaScript email address?

I'm using a paid WB template which uses a lot of JavaScript.  The template works really well, I like it, but the only problem I have is not being able to save the markup of a simple obfuscated JavaScript mailto: which I have in two other WB sites (but running on different templates).

What happens is that when I save the WYSIWYG section with the JavaScript in the source, the script disappears after saving and I end up with a straightforward mailto: which I don't want because of spam.  :-(

I have tried everything I know, so I thought to ask here. My ideas...

a) Instead of a WYSIWYG section is there a way to use a WB CODE section to achieve this?
b) Do I have to format a WYSIWYG section in such a way as to make the JavaScript script,  "stick" after saving and not disappear?
c) Do I have to somehow poke a hole in the HTML's page's JavaScript then insert the mailto Javascript code and then close the hole again ?
d) Is there a more modern approach to obfuscating the email address? With PHP perhaps? — I've been using the same Javascript method for the last 15 years.

I'm not a programmer but I can code some simple CSS. I already have a myname(arobase)gmail(point)com on my site already, but I would like to publish a clickable mailto link also.  :-)

My JavaScript script isn't faulty because the same script works with other WB templates. Other widget Javascript script that I've added to the index.php of the template works ok.

WB-Version
2.12.2 r379