New Revised CSS Library Forums Web Tools
FAQs Awards Usage Terms Contact
Categories
Other Sections
Sweet Ads
Compatibility
Bookmark online:


FF1+ IE5+ Opr7+

Easy Email Scrambler

Author: Dynamic Drive

Description: This script encrypts any email link on your webpage to hide them from harvesters and spammers. The script shines in its ease of implementation and extensive browser compatibility. To encrypt an email address, simply modify your existing "mailto:" link on the page with a specifically crafted email address instead, and the script does the hard work by dynamically modifying it to become valid for humans. Compatibility wise, the script works in all JavaScript enabled browsers, and even for those with JavaScript disabled, the resulting email link still works to a degree that allows the visitor to email you. Now that's one usable Email Scrambling script!

Demo: The below Email link is scrambled. The actual source reveals "mailto:ddrivehelp[at]yahoo.com":

Contact Us


Directions: Developer's View

Step 1: Insert the below script into the BODY section of your page, at the VERY END, following all links on your page:

Select All

Step 2: You are now ready to mask email links on your webpage! Simply edit your "mailto:" links with "encrypted" email addresses such as:

<a href="mailto:contact[at]microsoft.com">Contact Microsoft</a>
<a href="mailto:help[at]google.com">Contact Google</a>

Notice the custom divider "[at]" used in place of "@", which should suffice in hiding your email addresses from harvesters. However, you can use any custom divider you choose. The script will then replace all links carrying this divider with "@" dynamically, creating valid mailto links out of them.

For people with JavaScript disabled, your mailto links will still work, though the custom divider is not replaced. As long as your divider is intuitive enough, the visitor should know to replace that with "@" manually.