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.

Published Friday, August 6, 2004 2:12 PM by Alex Papadimoulis

Comments

Tuesday, August 10, 2004 8:34 PM by Stuart

# re: Javascript Anti-Spam Email Link (#2)

Using an image is a huge loss of functionality for the user. It's not clickable, it's not copy-able...

(Use a PNG not a GIF, anyway...)
Thursday, September 2, 2004 4:27 PM by mes

# re: Javascript Anti-Spam Email Link (#2)

I have a wife, then we need to thest life