Javascript email address obfuscation

BluJag

Perch
Free of charge from Jim Tucek at http://www.jracademy.com/~jtucek/email/index.php

This is a piece of javacript which encrypts email addresses using 10-bit RSA, so even if your site is visited by a spambot which understands JavaScript it won't find any plain text email addresses, just a garbled string that makes no sense at all - the email address only gets decrypted when someone clicks on the link, as intended. What's more, to prevent spambots from recognising source code, Tucek uses a server side script which randomly names all variables and functions.

An excellent and useful piece of code that should be on everyones website.

Rating 10/10
 
I wrote a simple javascript function to "hide" email addresses from spam bots too. I have it up on many sites such as http://www.ajaxscripts.com (sites I haven't put any content on yet). It's a bit more simple and just as effective. You can pull out the styles to make it even more simple.

Code:
<script language="JavaScript">
<!--
	function displayEmail(account, server, domain)
	{
		fulllink = "<a style='color: white;font-family:arial; font-size:10px; text-decoration: none' href='mailto:" + account + "@" + server + "." + domain + "'>" + account + "@" + server + "." + domain + "</a>";
		document.writeln(fulllink);
	}
-->
</script>
<script language="JavaScript">displayEmail("administrator","ajaxscripts","com");</script>


BluJag said:
Free of charge from Jim Tucek at http://www.jracademy.com/~jtucek/email/index.php

This is a piece of javacript which encrypts email addresses using 10-bit RSA, so even if your site is visited by a spambot which understands JavaScript it won't find any plain text email addresses, just a garbled string that makes no sense at all - the email address only gets decrypted when someone clicks on the link, as intended. What's more, to prevent spambots from recognising source code, Tucek uses a server side script which randomly names all variables and functions.

An excellent and useful piece of code that should be on everyones website.

Rating 10/10
 
Back
Top