Java Script to help protect email addresses from Spammers and Email Harvesters

Here's some simple Java Script code you can use to help hide your email address from email harvesters:

<script language="JavaScript"><!--
var abra = "username";
var ca = "@";
var dabra = "math.ualberta.ca";
document.write('<a href=\"mailto:' + abra + ca + dabra + '\">');
document.write(abra + ca + dabra + '</a>');
// --></script>

 To use it, just open your web page in a text editor (notepad, pico, etc.) and replace your current email link with the JS code. For example, in the following HTML:

<p>Please send comments to <a href="mailto:username@math.ualberta.ca">username@math.uablerta.ca</a></p>

The email link (in bold above) would be replaced with the JS code, resulting in the following:
(Make sure to change the email address shown in bold below to the one you desire.)

<p>Please send comments to 
<script language="JavaScript"><!--
var abra = "username";
var ca = "@";
var dabra = "math.ualberta.ca";
document.write('<a href=\"mailto:' + abra + ca + dabra + '\">');
document.write(abra + ca + dabra + '</a>');
// --></script>
</p>

 The above HTML will then appear as follows to a user viewing the web page:

Please send comments to

go back to main page