Link to home
Start Free TrialLog in
Avatar of AXISHK
AXISHK

asked on

Email address on web page

Is there any benefit to change all email address to a picture image on our website ?

Thx
SOLUTION
Avatar of Serena Hsi
Serena Hsi
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Obfuscating email addresses

This is how I define email addresses
<a href="" class="mail-link" data-d="derf"></a><br/>
<a href="" class="mail-link" data-d="ydnam"></a><br/>

Open in new window

JavaScript
<script src="http://code.jquery.com/jquery.js"></script>
<script>
var domain = ['somewhere','com']
$(function() {
  $('.mail-link').each(function(i, el) {
     var email = $(el).data('d').split("").reverse().join("") + '@' + domain.join('.');
     $(el).attr('href','mailto:' + email).html(email);
  });
});
</script>

Open in new window

I further obfuscate the above jQuery
Working sample here