Email obfuscated in HTML page

I am trying to design a page based on simple material design lite - similar to this page:

If you look in line 380 of source code the email address is given but it is obfuscated. Whenever I try the same I just copy and paste the whole section it does not work for me. My template page looks like this:


That text (value of the anchors href attribute) is simply HTML entity encoded. (Although I'm not convinced how effective that would be today to prevent the email being harvested.)

Should I encode it first and put it in the source?

Yes, you need to encode it first - it doesn't get automatically encoded (unless you are using some kind of framework/CMS that does this for you). Most server-side languages have functions built-in for HTML encoding/decoding.

This is not what i would call obfuscation - that is just encoding of entities. If you really want to obfuscate the email address use something like this:

 function hide(id) {
 document.location = id.replace(/\|/g, '');

 <button class="btn btn-default" data-to="mailto:[email protected]|doe|.|org" onclick="\|/g, '')">

Look at,js,output, how it works: you divide the string you want to obfuscate, and then put it together through user action.

Category: html5 Time: 2016-07-29 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.108 (s). 12 q(s)