Hide email adress with JavaScript

Posted by Martin Aleksander on Pro Webmasters See other posts from Pro Webmasters or by Martin Aleksander
Published on 2011-03-12T11:59:24Z Indexed on 2011/03/12 16:18 UTC
Read the original article Hit count: 357

Filed under:

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?

© Pro Webmasters or respective owner

Related posts about JavaScript