Skip to content
jayc313 edited this page Jan 16, 2018 · 1 revision

Welcome to the jEmailGenerator wiki!

jEmailGenerator works by using jQuery to help prevent crawlers indexing emails such as this:

<a href="mailto:test@gmail.com">test@gmail.com</a>

To use the plugin simply use: $( selector ).jEmailGenerator(); on an element with these 3 data attributes: 'data-eName', 'data-eHost' and 'data-eDomain'

For example: <a href="#" data-eName="test" data-eHost="gmail" data-eDomain="com"></a>

Will output <a href="mailto:test@gmail.com" data-eName="test" data-eHost="gmail" data-eDomain="com">test@gmail.com</a> after the page has loaded.

Plugin Arguments

Currently, the plugin only accepts 2 arguments

  • Text
  • Redirect

The "Text" argument will change the text displayed inside of the element. If the value is left undefined the text will default to being the email address.

If the "Text" argument is set to false it will keep the text that is currently within the element.

The "Redirect" argument is a boolean which when set to true will redirect the user to the email link rather than actually adding the link to the href attribute.

Further Documentation/Examples can be located in both example.html and example.js