Skip to content

Instantly share code, notes, and snippets.

@namklabs
Last active January 2, 2016 18:18
Show Gist options
  • Save namklabs/8342178 to your computer and use it in GitHub Desktop.
Save namklabs/8342178 to your computer and use it in GitHub Desktop.
// https://github.com/mikebranski/jquery-nospam
// implementation
$(function(){
function reverse(s){
return s.split("").reverse().join("");
}
var tld = addr.substring( addr.lastIndexOf('.') + 1 );
var domain = addr.substring( addr.lastIndexOf('@') + 1, addr.lastIndexOf('.') );
var address = addr.substring( 0, addr.lastIndexOf('@') );
$('.email').attr('rel', reverse(tld) + '/' + reverse(domain) + '//' + reverse(address) );
$('.email').nospam({
replaceText: true,
filterLevel: 'normal'
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment