WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.8 is now available!


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.12.x) »
  • General Help & Support »
  • How do I create a JavaScript email address?
  • Print
Pages: [1]   Go Down

Author Topic: How do I create a JavaScript email address?  (Read 7420 times)

Offline Nicky

  • Posts: 94
  • Gender: Male
How do I create a JavaScript email address?
« on: May 03, 2020, 06:30:50 PM »
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
Logged

Offline dbs

  • Betatester
  • **
  • Posts: 8920
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: How do I create a JavaScript email address?
« Reply #1 on: May 03, 2020, 07:13:20 PM »
Hello, are you familiar with the function for masking e-mail addresses?
https://help.WebsiteBaker.org/en/userguide/working-with-wb/admin-tools.php#anchor4
Logged
https://onkel-franky.de

Offline LudwigSt

  • Posts: 449
  • Betatester
Re: How do I create a JavaScript email address?
« Reply #2 on: May 04, 2020, 10:24:58 AM »
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.
Logged
LG Ludwig

Wissen ist Macht - aber nix wissen macht auch nix.

Offline Nicky

  • Posts: 94
  • Gender: Male
Re: How do I create a JavaScript email address?
« Reply #3 on: May 04, 2020, 02:56:29 PM »
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,

N  :-D
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.12.x) »
  • General Help & Support »
  • How do I create a JavaScript email address?
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2