I read somewhere that hiding email address behind JavaScript code, could reduce spam bots harvesting the email address.
<script language="javascript" type="text/javascript">
var a = "Red";
var t = "no";
var doc = document;
var b = "ITpro";
var ad = a; ad += "@"; ad += b; ad += "."; ad += t;
var mt = "ma"; mt += "il"; mt += "to";
var text = "";
if (text == null || text.length == 0)
text = ad;
doc.write("<"+"a hr"+"ef=\""+mt+":"+ad+"\">"+text+"</"+"a>");
</script>
This will not display the actual email-address in the sourcecode of the page, but it will display and work like a normal link for human users.
Is it any point of doing this? Will it reduce spam bots, or is it just nonsense that might slow down performance of the page because of the JavaScript?
foo[at]bar.commight not cut it these days, yet the more elaborately you decorate the address, the more likely it is to confuse users as well. Using CSS/JS obfuscates the address while still allowing users to read it or copy and paste it. – Lèse majesté Mar 12 '11 at 12:28