Categories:

Home / Free JavaScripts / Email and Email Validation / Here

Cut & Paste Anti-spam email displayer

Credit: JavaScript Kit

Description: This is a powerful anti-spam script that lets you display email addresses on your site without spam harvesters being able to pick up on them. It is unique in the following ways:

  • Enter email addresses into the script using the simple format "chris[at]whatever[dot]com". The script will dynamically replace [at] and [dot] at run time for anti spam purposes.
  • Easily display email addresses in 2 different modes: 1) A drop down menu 2) Plain text and email link.
  • Display a list of email addresses, or just one from the list.
  • Pass in an optional CSS classname to easily style the email addresses.

Examples:

(Single Email)

Directions:

Step 1: Cut and paste the below script into the <head> section of your page:

Inside the script, input the desired email addresses per the comments. 

Step 2: You now need to invoke the function displaycontact() to actually show the emails on the page. Here are a few examples:

<script type="text/javascript">
//display emails using dropdown menu with height of "1"
displaycontact(contacts, "formstyle", "form", "1")
//display emails using regular text links, separated by "<br>"
displaycontact(contacts, "textstyle", "text", "<br>")
//display the single email address contacts[2] from array
displaycontact(contacts[2], "textstyle", "text", "")
</script>

Refer to the comments listed at the bottom of the script in Step 1 for full usage instructions.


JavaScript Tools:
Site Info

CopyRight 1998-2014 JavaScript Kit. NO PART may be reproduced without author's permission.