Hide E-mail Address From Spammer in HTML

Posted on the September 2nd, 2008 under JavaScript, Programming, Savvy.UI, Tutorial by Zaki

There’re multiple way to hide E-mail Address in your HTML page from being fetch/grab by spammer, today let me show you one way of doing it using simple JavaScript and Savvy.UI JavaScript Library.

Email me to <span class="mailto"></span>

Here’s an example how you can transform all span.mailto to display and link an e-mail.

Js.simplify();
var email = ["zaki","codenitive.com"].join("@"); // just edit this line;
 
$(document).ready(function() {
	$("span.mailto").each(function() {
		$(this).add("a", {
			href: "mailto:" + email,
			title: "Email to " + email
		}).text(email);
	});
});

No Responses to 'Hide E-mail Address From Spammer in HTML'

Subscribe to comments with RSS or TrackBack to 'Hide E-mail Address From Spammer in HTML'.
Leave a Reply
XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="">