Replace MAILTO HREF Tags with Javascript to prevent Spam

cberic3

macrumors newbie
Original poster
Aug 13, 2005
12
0
I wrote this quick little hint about how to replace all of your "mailto" tags with a small bit of javascript. This is probably common knowledge to experts but for anyone who doesn't know, just trying to contribute to the anti spam cause!

Questions, comments, and feedback are VERY welcomed. I just built this site in the last 2 weeks all from scratch. If you find the article helpful, share it, blog it, link it, anything!

http://computing.adviceuniverse.com/web/20050825mailtojavascript

-Eric

ps - Im a rookie developer so if its rough, be gentle!
 

wrc fan

macrumors 65816
That's good advice, I've been doing it with sites I make for a year or so now. I also add a <no script> where I put the email address (without a link) and @ replaced with [AT]. Just in case any random people happen by that don't have javascript enabled.
 

cberic3

macrumors newbie
Original poster
Aug 13, 2005
12
0
Thanks. For some reason my reference can make the script work with firefox, but for some reason when i check my source in firefox, the code in the header is all gray, whereas the reference pages's source work correctly. Makes no sense considering they are exactly the same.

-Eric
 

cberic3

macrumors newbie
Original poster
Aug 13, 2005
12
0
Eureka! Removing the comments out of the script in the header fixed the Firefox issues.

-Eric
 

cberic3

macrumors newbie
Original poster
Aug 13, 2005
12
0
mnkeybsness said:
I've always found the Enkoder Form to ward off spammers the best.
Rock on, I just downloaded that app. The advice I posted was intended to be platform independent, because not everyone is as lucky as us to be rockin' macs ;)

-Eric
 

mnkeybsness

macrumors 68030
Jun 25, 2001
2,511
0
Moneyapolis, Minnesota
cberic3 said:
Rock on, I just downloaded that app. The advice I posted was intended to be platform independent, because not everyone is as lucky as us to be rockin' macs ;)
What are you talking about? Download an app? All that site does is encode your email address and gives you a javascript decoder. It has nothing to do with what platform you are on.
 

cberic3

macrumors newbie
Original poster
Aug 13, 2005
12
0
wait a minute, that looked like an app that i had downloaded earlier yesterday that does roughly the same thing. my bad.

-Eric