There are lots of times I want to put an email address on a web page, but I always fear the spam bots that harvest email addresses and clog your inbox with tons of shit about drugs and mortgages. A lot of times you’ll see people do things like write jenn y [[[ a t ]]] hack addict ((( dott ))) ne t
jenn<span>y</span> <span> </span>[[[ <span> a<span>t</span> </span>]]] hack<span>addict</span> ((( dott ))) <span>ne</span>t
That’s still not an ideal solution because it’s not much harder to parse and it looks like crap to the human user. The user can’t just click on the email to send a message since there’s no mailto: link. Furthermore, the user can’t even copy and paste the email address because of all the brackets and reformatting.
var e = “hackaddic”;
e = “@” + e;
e += “t.net”;
e = “jenny” + e;
var nspm = “mailto”;
nspm = nspm + “:” + e;
nspm = “<a href=’” + nspm +”’ title=’Send Questions or Comments to’>Contact</a>”;
document.onload += document.write(nspm);
The above code works fine in a blogger template, a feat which took a little work to accomplish because of the way blogger checks for matching tags when it compiles your template. You can see an example of this code at the top of the page.