Return to Snippet

Revision: 21531
at April 6, 2011 07:05 by coryschadt


Updated Code
//email spam protection - Example Markup: <span class="email">name[at]domain[dot]com</span>
$('.email').each(function() {
  var $email = $(this);
  var address = $email.text()
  .replace(/\s*\[at\]\s*/, '@')
  .replace(/\s*\[dot\]\s*/g, '.');
  $email.html('<a href="mailto:' + address + '">'+ address +'</a>');
});

Revision: 21530
at December 15, 2009 12:07 by coryschadt


Initial Code
//email spam protection - Example Markup: <span class="email">name[at]domain[dot]com</span>
$('.email').each(function() {
	var $email = $(this);
	var address = $email.text()
	.replace(/\s*\[at\]\s*/, '@')
	.replace(/\s*\[dot\]\s*/g, '.');
	$email.html('<a href="mailto:' + address + '">'+ address +'</a>');
});

Initial URL


Initial Description


Initial Title
jQuery - Scramble Emails

Initial Tags
jquery

Initial Language
jQuery