Use JavaScript To Protect Your Email Address

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>
Published on: September 19th in Tutorials .
Post tags: , , , , ,

2 Comments

  • Lings
    May 31, 2010
    • reADactor
      May 31, 2010

Leave A Comment.