Created
February 10, 2016 02:26
-
-
Save habibimroncn/ce29beb9f4e36b78c5ca to your computer and use it in GitHub Desktop.
jQuery Scramble Web Page Email Addresses from Sam Deering
This file contains 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
jQuery(document).ready(function($) { | |
//email spam protection - Example Markup: name[at]domain[dot]com | |
$('.email').each(function() { | |
var $email = $(this); | |
var address = $email.text() | |
.replace(/s*[at]s*/, '@') | |
.replace(/s*[dot]s*/g, '.'); | |
$email.html(''+ address +''); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment