Use JavaScript To Protect Your Email Address
Sometimes is still necessary to use standard link email address in the contact page. Also, are clients who ask beside to the dynamic contact form, to be inserted and one or more standard email addresses.
In case you are looking for a method to protect the email address code line from spam spyders and crawlers, you can use a simple javascript code what will compile you email address:
<script language="javascript">
var username= "name";
var hostname = "yourdomain.com";
var linktext = username + "@" + hostname;
document.write("<a href=" + "mail" + "to:" + username + "@" + hostname + ">" + linktext + "</a>")
</script>
Post tags: code, email, javascript, protection, spam, tutorial














May 31, 2010
Good idea, but what about people without JavaScript?
May 31, 2010
use a php contact form.