Blog

Spam-safe mailto without images

by Bobby Whitman

close  

Every web developer should be well aware that if your e-mail address appears on your website in text, you should expect an increase in spam. To thwart spammers you will often see e-mail addresses placed in images to be displayed on the web. I used to do it this way myself, but recently I have shifted to a method that is much easier implement and should work just as well.

The solution: use JavaScript. By using a programming language like JavaScript to build a string and display it, evil spamming robots can scrub my site all they’d like and never find my e-mail address in the code.

<a href=”javascript:location.href = ‘ma’ + ‘i’ + ‘lto:b’ + ‘ob’ + ‘b’ + ‘y@’ + ‘d’ + ‘y’ + ‘na’ + ‘mi’ + ‘t.u’ + ‘s’;”><script type=”text/javascript”>document.write(‘b’ + ‘ob’ + ‘b’ + ‘y&’ + ‘#’ + ’64;d’ + ‘y’ + ‘na’ + ‘mi’ + ‘t.u’ + ‘s’);</script></a>

    Post Comment

    Check Ins

    Bobby Whitman is at Port Columbus International Airport (CMH) ...
    Fri, Feb 3

    Check Ins

    Bobby Whitman is at The Alamo in San Antonio, TX
    Thu, Feb 2

    Twitter

    I just backed The Mounty on @Kickstarter http://t.co/Zs4XSZnz

    Posted on Thu, Feb 2
    by pomajp

    Check Ins

    Phil Franks is at Whataburger Home Office in San Antonio, TX
    Wed, Feb 1

    Check Ins

    Phil Franks and Bobby Whitman are at San Antonio International...
    Wed, Feb 1