A jQuery plugin that helps you to hide your email on your page and prevent crawlers to get it!
It's super simple.
you can use data attributes to make sure crawlers won't parse it easily, just like this
<a class="mail" href="" data-u="johndoe" data-d="domain" data-e="com" data-s="subject" data-b="body">Contact me!</a>
See how data attributes are used :
One last thing, if you don't put anything between the <a><a>
, your email is printed by default.
Include in the bottom of your page jQuery and the plugin, for instance :
<script src="js/jquery.min.js"></script> <script src="js/jquery.hideMyEmail.min.js"></script>Then, the plugin itself :
<script src="js/jquery.hideMyEmail.min.js"></script>
Finally, either put just after this or in another javascript file include and call the function on a jQuery selector :
$(document).ready(function(){
$('a.mail').hideMyEmail();
});
and voilà!
Download the plugin
jquery.hideMyEmail.min.js, only 438 o!
Check the source on this link, and try it : Contact me!
Otherwise, you can just go at this demo link
Author: Alexandre Vasseur, freelance web developer
Contact :