Email Cloaking via Javascript?

14 views
Skip to first unread message

TylerL

unread,
Feb 3, 2009, 7:48:04 PM2/3/09
to Webmasters Helping Webmasters
How effective is this code at cloaking an email address from a address
harvesting spider?

(withing the <head> tags)
................
<!--

function gemaddr(node, domain, local) {
var a = String.fromCharCode(64);
var mt = String.fromCharCode(109,97,105,108,116,111,58);
node.href = mt + local + a + domain;
return true;
}
//]]>
//-->
</head>

(individual email link in the <body> tags)

<a href="need_js.html" onclick="gemaddr(this, 'domain.com',
'JohnDoe')">

<img src="images/johnDoeEmail.jpg"alt="JohnDoe at domain dot com"
title="cJohnDoe at domain dot com" border="0" height="13" width="93" /
>
</a>

Vision Jinx

unread,
Feb 3, 2009, 11:36:01 PM2/3/09
to Webmasters Helping Webmasters
Hi,

With out starting a debate over the capabilities of email harvester
bots, I think it may be best to understand the "nature of the beast" a
bit to get a grasp on different approaches to try to combat it.

For the most part the bots scan pages for things like "mailto" and "@"
but some of the more sophisticated ones may have some basic javascript
capabilities (like character code conversions) and some can read
characters in images (use CAPTCHA images possibly there) so just using
an image with your addy in it will not be fully effective as spammers
sell and trade lists so if one is able to get it then soon many will
have it.

But if just using Javascript then I would suggest to have things
dynamically generated when possible (I like AJAX personally loading
and posting to a PHP form) but even just basic javascript will help.

I made a basic demo page here you can have a look at >>
http://www.visionjinx.net/demos/email_demo.htm

Note: This still wont prevent someone from manually getting it from
your site (since it's client side), there you need an email form or
something (server side), but there are free services available for
this also.

I would also maybe use a button (in your case example over an image
tag and link) with the image being loaded via css (background image
style) to help there possibly from reading image characters and tag
attributes etc.

Tip: If using a Google service like Sites, Pages or Blogger then a
Google Gadget may be better suited. I can help whip up a basic one if
needed to get you going.

Anyways, have a look and see of that helps :)

Cheers!
Vision Jinx

tyler

unread,
Feb 4, 2009, 11:13:45 AM2/4/09
to Webmaste...@googlegroups.com
Thank you for your prompt, thorough, and informative response!  I may take you up on your offer if I get stuck in a timesink.  Thanks again!
Reply all
Reply to author
Forward
0 new messages