You have a web site and you want your visitors to be able to contact you. For one reason or another you do not want to use a web based contact system and through fear of being bombarded left, right and center with spam, you do not want to put a mailto link on your contact page. So your visitors are left with no way of contacting you.

The majority of spam bots crawl the net in search of e-mail addresses in plain text such as:

One way of making it more difficult for a spam bot to find your email address is to conceal it within your page. This is where JavaScript comes in useful; being a client side scripting language your scripts are sent to the client and left to their web browser to execute. It is possible to write a script that gets the browser to generate a mailto link with your e-mail address in without sending it in plain text. There are many ways of doing this, such as using encryption and bit shifting, but by far the easiest way is to use the String.fromCharCode() function. This function takes any number of ASCII character codes as arguments and generates the corresponding character. With the help of an ASCII character code table, this simple function will do the trick:
<script language=”JavaScript1.2”>
function makelink ()
	var str;
	str = "<a href=\"";
	str = str + String.fromCharCode(109, 97, 105, 108, 116, 111, 58);

	// first part of the address
	str = str + String.fromCharCode(109, 101);

	// the at sign
	str = str + String.fromCharCode(64);

	// the domain part
	str = str + String.fromCharCode(109, 121, 100, 111, 109, 97, 105, 110, 46, 99, 111, 109);

	str = str + "\">Contact Me</a>";
	return str;			
This function will generate a string: “<a href=””>Contact Me</a>”
You can then include this string anywhere in your page using the following scriptlet:
<script language="JavaScript1.2">
		document.write (makelink ());
I’m not saying using this method will make it impossible for spammers to get your e-mail address, but it does add a layer of protection and these days the majority of good web browsers support JavaScript.