This jQuery plugin turns an obfuscated e-mail address into a human-readable one. It’s lightweight and accepts multiple filtering levels for additional security. No Spam works on mailto links and other HTML elements, automatically detecting which you’re applying it to.
No Spam has two filter levels that determine how your e-mail address should be formatted when it’s passed in: low and normal (default).
normal looks for a reversed email address with the at sign (@) to be replaced with two forward slashes (//) and periods (.) to be replaced with single slashes (/). Reversing it provides an extra level of protection. Example: email@example.com should be passed as
email@example.com
moc/elpmaxe//liame
low looks for an email address with the at sign (@) to be replaced with two forward slashes (//) and periods (.) to be replaced with single slashes (/). The only difference between low and normal is that low does not require the e-mail to be reversed. This method is still effective and is also more natural to read and type, but still tricky for a bot to untangle. Example: email@example.com should be passed as
email//example/com
$('a.email').nospam();
<a href="#" rel="moc/elpmaxe//liame" class="email">Email Me!</a> would become Email Me!
<a href="#" rel="moc/elpmaxe//liame" class="email">Email Me!</a>
$('a.email').nospam({ replaceText: true });
<a href="#" rel="moc/elpmaxe//liame" class="email">Email Me!</a> would become email@example.com
$('a.email').nospam({ filterLevel: 'low' });
<a href="#" rel="email//example/com" class="email">Email Me!</a> would become email@example.com
<a href="#" rel="email//example/com" class="email">Email Me!</a>
$('span.email').nospam(); // always replaces text when not a link
<span>moc/elpmaxe//liame</span> would become email@example.com
<span>moc/elpmaxe//liame</span>
$('span.email').nospam({ filterLevel: 'low' });
<span>firstname/lastname//example/co/uk</span> would become firstname.lastname@example.co.uk
<span>firstname/lastname//example/co/uk</span>
I created a PHP companion function to No Spam that allows you to wrap an e-mail address in a PHP function that will automatically format it for use with No Spam so you don’t have to manually change anything! More details here http://www.leftrightdesigns.com/library/jquery/nospam/php- integration.ph…