Protecting Addresses from Spammers
As you know, spam is a big annoyance. One of the largest sources of spam comes from email addresses being taken from web pages through data extraction tools, such as automated scanners or screen scrapers. In an effort to both provide ease of use to your site visitors and to protect your email addresses from these screen scrapers, ITS has created a helpful little utility. Basically, this utility will allow you to break up the email address so a screen scraper can't identify it, but still allow users to click on the hyperlink and have an email message start up. Here's how you take advantage of this utility:
In the <head> section of your page, include the following JavaScript reference:
<script language="javascript" src="/email.js"></script>
Putting this in the <head> section will allow your page to use the JavaScript file that has a couple of functions used to protect your email.
When you want to create a mailto: in your page, use the following syntax instead of the typical <a href="mailto:"></a> syntax:
<a href="javascript:MailToLinkClick('<account>','<domain>')" onmousemove="MailToLinkOver('<account>','<domain>')" onmouseout="MailToLinkOut()"><mailLinkText></a>
Where <account> is your email account, <domain> is the email server name, and <mailLinkText> is the text you want for the link. So, if I had an email address of mojo@tufts.edu, my code would be:
<a href="javascript:MailToLinkClick('mojo','tufts.edu')" onmousemove="MailToLinkOver('mojo','tufts.edu')" onmouseout="MailToLinkOut()">Mojo's Email</a>
As you can see, this creates a functional email link without using the actual email address. Please note that this is on a link by link basis, so you'll need to do this to all of your mailto: links to be safe.
|