Nik's Technology Blog

Travels through programming, networks, and computers

Website Spam Avoidance - Javascript Code

Use the following JavaScript if you want to display an email address on your website, but you don't want to receive spam mail. It will avoid getting picked up by Spammer's email collecting scripts.

<script language="JavaScript" type="text/javascript">

<!--

var LinkText = "click here";

var e1 = "mail";

var e2 = "to:";

var EmailPart1 = "yourname";

var EmailPart2 = "yourdomain";

var EmailPart3 = ".com";

document.write("<a h" + "ref=" + e1 + e2 + EmailPart1 + "@" + EmailPart2 + EmailPart3 + ">" + LinkText + "</a>")

//-->

</script>

Comments are closed