EmailMe
Spammers are good at their job, but we make it easy for them.
I use this piece of JavaScript on my About page to display my email address. To a viewer with eyes it's fine, but no screen scraper'll be harvest this email. No sir. The main goal is to never store the email address as a complete string that a regular expression could recognize. So, if your email address is yourself@example.com you would plug this in to a JavaScript file, and reference it in the page header.
EmailMe JavaScript
//eat this, spammers!
function emailMe(){
var email = "<a href='mailto:yourself"
+ "@example.com?subject=Contact from example.ca'>yourself"
+ "@example.com</a>";
document.getElementById('emailme').innerHTML = email;
}
window.onload = emailMe;
Then in the HTML you place the container span tag which is to be filled.
EmailMe HTML
<span id="emailme">[ yourself [at] example [dot] ca ]</span>
This means that someone with JavaScript turned off won't see it. I don't worry, those people are either paranoid, visit really sketchy sites, or both.
8 Comments
Mar 4, 2007
7:25 pm
Good stuff man, I'm definitely throwing that into my site. Did you do that yourself?
Mar 5, 2007
8:20 am
Yeah, I wrote it. I also recommend writing your own comment system. Thus far I have had zero spam comments. To me it is more fun to write your own than and have a million problems than to spend even one hour deleting spam messages.
May 6, 2007
12:53 pm
I eventually got spam on my home-brewed one, though, to be fair, mine used ordinary form submits, without any ajax voodoo.
Jun 30, 2007
2:37 am
good script ... and yes, doing it yourself is always better
Jul 12, 2007
3:13 pm
lol I fit in the "both" category ;-)I created
Jul 27, 2007
7:43 pm
I wrote my own comment system, ended up getting some spam, and then wrote my own captcha system too :) It's pretty simple, but it's good enough to fend off the moronic bots.
Aug 30, 2007
12:39 am
fghgf
Jan 24, 2008
9:11 am
dsds