Email Spam Protection

jQuery Plugin to protect email addresses in websites from crawlers
http://unckel.de/labs/jquery-plugin-email-spam-protection/

This is a simple jQuery plugin to protect email addresses from crawlers to avoid spam. Crawler are not able to collect email addresses from websites. If javascript is not available, users will not see clickable but readable email address. If javascript is activated, users will see a clickable email address including @-Char.

With javascript: info@domain.com
Without javascript: info [at] domain.com
Download
jQuery.emailSpamProtection.1.0.js (1kB)

How to use

  1. Write each email in HTML in this way: <span class="email">info [at] domain.com</span>. Span tags are perfect, but you can also use other tags. It is important, that they have a class attribute.
  2. Include jQuery and the plugin.
  3. Use $("body").emailSpamProtection("email"); to initialize the plugin. It works within the "body" tag or all other tags (div, table, etc.) and search for class name "email".

Example & Demo

<script src="jquery.1.4.2.js"></script>
<script src="jquery.emailSpamProtection.1.0.js"></script>
<script>
$(function() {

  $("body").emailSpamProtection("email"); 

});
</script>

<body>
  Write me: <span class="email">info [at] domain.com</span>!
</body>
Write me: info [at] domain.com!

Contact and Terms of Use

Author: Mike Unckel - Contact / Feedback.

Using this script and information at your own responsibility and own risk.

Copyright © M. Unckel, 2010