return to homepage

Scripts: Javascript

Anti-spam Email Script

To enable you to display email addresses on web sites without spambots etc using them, you can break down the email address into the 'email user name' and the 'domain name'.

email me using this anti-spam script

<SCRIPT Language="JavaScript">
<!--

function postIt(postName,postServer) {
top.location.href='mailto:'+postName+'@'+postServer;
}

//-->
</SCRIPT>

<A HREF="JavaScript:;postIt('john.smith','hotmail.com')">email me using this anti-spam script</A>

This can be further enhanced by automatically filling in the subject and body fields of the email:

email me using this anti-spam script

<SCRIPT Language="JavaScript">
<!--

function postIt(postName,postServer) {
top.location.href='mailto:'+postName+'@'+postServer+'?Subject=This is the suject field&Body=...and this is the body field.%0d%0a%0d%0aRegards\, Jason';
}

//-->
</SCRIPT>

<A HREF="JavaScript:;postIt('john.smith','hotmail.com')">email me using this anti-spam script</A>