Created
October 7, 2012 08:03
-
-
Save santosh/3847486 to your computer and use it in GitHub Desktop.
JavaScript: Prevent email ID to be harvested by bots
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// it will only work until harvester is a crawler | |
// "human" harvesters can't be prevented from this | |
// | |
// write your email address and put some extra weird | |
// characters in it, e.g. [email protected] | |
// now replace your weird characters with "nothing". | |
var link = document.getElementById('email'); | |
link.href = link.href.replace(/NOSPAM/,''); | |
link.title = link.title.replace(/NOSPAM/,''); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I never knew after 4 years I will come searching this gist for a client work. Implementing it on ajneffects.com.