No Spam v1.3

by Mike Branski

This jQuery plugin turns an obfuscated e-mail address into a human-readable one. To use this plugin, include jquery.nospam.js and call the nospam() method. No Spam automatically detects if your matched element is a link. If so, it checks the rel attributes for the obfuscated e-mail addresses. For all other elements, it uses the text between the matched tags. Now supports multiple dots (.) both before and after the at (@) sign!

<script type="text/javascript">
  $(document).ready(function(){
    $('a.email').nospam({
      replaceText: true,    // BOOLEAN, optional default false. If set to true, replaces matched elements' text with the e-mail address
      filterLevel: 'normal' // STRING, optional accepts 'low' or 'normal', default 'normal'.
                            // low: email/domain/tld
                            // normal: dlt/niamod/liame (email/domain/tld reversed)
    });
  });
</script>

Integration

To make things easier, I also created a PHP function called nospam() that formats your regular e-mail addresses dynamically and outputs them in a No Spam-ready format which I've made available for download.

Default, no options

$('a.email').nospam();
This:
<a href="/contactform.php?contactID=1164" rel="moc/liamg//iksnarbekim" class="email">Mike Branski</a>
Becomes: Mike Branski

Replace Text, Filter Level low

$('a.email_replace_low').nospam({
  replaceText: true,
  filterLevel: 'low'
});
This:
<a href="/contactform.php?contactID=1164" rel="mikebranski//gmail/com" class="email_replace_low">Mike Branski</a>
Becomes: Mike Branski

Non link, Filter Level low

$('span.email').nospam({
  filterLevel:'low'
});
This:
<span class="email">mikebranski//gmail/com</span>
Becomes: mikebranski//gmail/com

Multiple dots (.), Filter Level low

$('a.email').nospam({
  filterLevel:'low'
});
This:
<span class="email">mike/branski//gmail/co/uk</span>
Becomes: mike/branski//gmail/co/uk