Adding javascript to a Page.
-
I am aware that there is a little bit of documentation surrounding this, but not enough.
1. The website https://w2.syronex.com/jmr/safemailto/ is an awesome email anti-spam concept. They offer a free javascript code, to be inserted into a page, allowing a ‘mailto’ on your website, while stopping spambots from picking it up.
2. I’ve looked at WP’s support page, for inserting javascript: https://codex.www.ads-software.com/Using_Javascript#Javascript_in_Posts
3. The problem is that the javascript does not work, once inserted into – in my case – my ‘contact me’ WordPress Page.
4. I’ve spoken to the website’s support team, and their response is
Here is what you need to put in your post:
<script type=”text/javascript”
src=”https://trashmedia.co.za/wp-content/themes/comicpress/spamblocker.js”></
script>
<script type=’text/javascript’><!–
show();
//–></script><noscript><a
href=’https://w2.syronex.com/jmr/safemailto/#noscript’>Click here (guarded
by anti-spam solution)</noscript>And this goes into spamblocker.js:
function show(){
var v2=”H8HCEH4Y4YGGT8SBHSUTPXA”;var
v7=unescape(“%22%5D%3A%26%281t-F84/9%5D7+%29%7D6%3B%7E%22%20”);var
v5=v2.length;var v1=””;for(var
v4=0;v4<v5;v4++){v1+=String.fromCharCode(v2.charCodeAt(v4)^v7.charCodeAt(v4)
);}document.write(‘<a href=”javascript:void(0)”
onclick=”window.location=\’mail\u0074o\u003a’+v1+’?subject=Via%20the%20Trash
%20Media%20website’+’\'”>’+’Click here<\/a>’);
}‘spamblocker.js’ is simply a text file that I created, and changing the extension to ‘.js’. I inserted the code he suggested above, and put it into the relevant directory.
If you’re interested in seeing my domain, it is https://www.trashmedia.co.za.
Can anybody help me with getting this to work?
- The topic ‘Adding javascript to a Page.’ is closed to new replies.