Javascript Anti-Spam Email Link (#2)

Jason Mauss posted a neat Javascript trick to hide your email address from Spam Bots using a document.write, and I've seen similar techniques using some pretty advanced encoding functions.

That got me thinking ... I'm sure it wouldn't be too hard to program a clever spam bot that would utilize the DOM to read rendered HTML (kind of like how JAWS does), instead of looking for email patterns. What about using a trick like this:

<scr ipt> function MailMe(t,n,d) { window.location = 'mai' + 'lto:' + n + '@' + d + '.' + t; } </sc ript> <a href="JavaScript: MailMe('com','alex','papadimoulis')">Mail Me!</a>

And if it's absolutely important that the email address appears visible to user (like, sales@example.com), just cut that as a GIF instead of using plain text. I haven't tried it yet, but I'm thinking, that could be the way to go.

2 Comments

Comments have been disabled for this content.