AR e-mail antispam - jQuery plug-in

Introduction

jQuery plug-in for creating e-mail link from element which contain hidden data about e-mail. This is good for hidding e-mail link from crawling by robot.

Download

Download (.js file)

API

Call plug-in


$(document).ready(function() {
  $('.mail').emailAntispam({
      'emailAT' : '[at]',
      'emailDOT' : '[dot]',
      'eparser' : ',',
      'enam' : 'info',
      'edom' : 'domain',
      'etld' : 'cz'
  });
});

emailAT

  • [string] character or string used for rendering e-mail apersant (@)
  • Default: “[at]”

emailDOT

  • [string] character or string for rendering e-mail dot (.) before TLD (Top Level Domain)
  • Default: “[dot]”

eparser

  • [string] character for parsing string to get e-mail parts from element content
  • Default: “,” (comma)

enam

  • [string] default name for e-mail rendering if not set name part
  • Default: “name”

edom

  • [string] default domain name for e-mail rendering if not set domain part
  • Default: “domain”

etld

  • [string] default TLD (Top Level Domain) for e-mail rendering if not set TLD part
  • Default: “tld”

Examples of use in html code

General set up info: to set default part just leave blank given part in html code.

1) set all part

html code:
<a class=”mail”>name,domain,tld</a>

Render:
<a href=”mailto:name@domain.tld”>name[at]domain[dot]tld</a>

live:name,domain,tld

2) no part set

html code:
<a class="mail" href=""></a>

Render:
<a href=”mailto:name@domain.tld”>name[at]domain[dot]tld</a>

live:

3) set only name

html code:
<a class="mail" href="">name</a>

Render:
<a href=”mailto:name@domain.tld”>name[at]domain[dot]tld</a>

live:name

4) set only domain

html code:
<a class="mail" href="">,domain</a>

Render:
<a href=”mailto:name@domain.tld”>name[at]domain[dot]tld</a>

live:,domain

5) set only tld

html code:
<a class="mail" href="">,,tld</a>

Render:
<a href=”mailto:name@domain.tld”>name[at]domain[dot]tld</a>

live:,,tld

6) set domain and tld

html code:
<a class="mail" href="">,domain,tld</a>

Render:
<a href=”mailto:name@domain.tld”>name[at]domain[dot]tld</a>

live:,domain,tld

7) set render part

html code:
<a class="mail" href="">name,domain,tld,content</a>

Render:
<a href=”mailto:name@domain.tld”>content</a>

live:name,domain,tld,content

Licencing

MIT licence or Apache licence 2

- basically free for use

- leave note of copyright would be appreciated, thanks

 

release notes

-