Jump to content


A Spamless Email Link

  • This topic is locked This topic is locked
No replies to this topic

#1 Deverill


    Immediate Family

  • Members
  • PipPipPipPip
  • 3,307 posts

Posted 20 September 2003 - 05:51 PM

I recently found a Javascript that has cut my spam mail down dramatically. Unfortunately I don't remember where I saw it (probably in a TCH forum!) but I thought it would be a good addition here in the tutorials section.

The basic idea is that Javascript builds the link on the browser end in a way that spam searchers can't see it but regular folks can click on it and activate their normal email mechanisms just like with a mailto tag.

Spam emails dropped a lot about 1-2 weeks after I implemented it. The code below is set for my email address "webmaster@jimscomputing.com" so make sure you edit it accordingly.

To use it just go to a place in your website where you want an email link, or have one now, and replace the "<a href " with the script below. It will show up in your document as the actual email address and you can put text before and/or after the <script> and </script> tags to make the address show up in a sentence like "Contact us at..."

<script language="JavaScript">
user = "webmaster";
domain = "jimscomputing.com";
document.write('<a href=\"mailto:' + user + '@' + domain + '\">');
document.write(user + '@' + domain + '</a>');

"A winner is simply willing to do what a loser won't."

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users