Mailifier is a jQuery plugin that allows you to display emailaddresses in webpages whilst preventing spambots from harvesting them.
- Mailifier is fast and compact.
- Being a jQuery plugin it is easily implemented.
- It allows for easy extending and customization.
Original HTML:
<span class="email">user [at] example [dot] com</span>
Javascript:
$("span.email").emailify();
Resulting HTML:
<span class="email"><a href="mailto:[email protected]">[email protected]</a></span>
View this example at jsfiddle.
jQuery 1.4.4 or higher.
-
Include the plugin on your web page:
<script src="jquery.vm.emailifier.min.js" type="text/javascript"></script> -
Contain obfuscated emailadresses in an arbitrary element:
<span class="email">tim [at] example [dot] com</span>
<span class="email">bob [at] example [dot] com</span>
-
Emailify the addresses:
$(document).ready(function() {
$("span.email").emailify();
});
The options are to be passed in an object. None are mandatory.
OPTION | TYPE | DEFAULT | REMARK |
---|---|---|---|
atSign | string | " [at] " | String that will be replaced by '@'. |
dotSign | string | " [dot] " | String that will be replaced by '.'. |
substitute | function(string) | The substitute html can be customized by passing in a function. It receives the deobfuscated address as a parameter and should return the substitute html. |
Emailifier was developed by Roel van Dijk, Anne Fortuin, Rolf Timmermans and Thijs Brilleman.
Copyright 2011 Voormedia - www.voormedia.com
Emailifier is released under the MIT license.