Email obfuscated in HTML page

I am trying to design a page based on simple material design lite - similar to this page: http://fxpblog.co/firefox/nightly/.

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: http://codepen.io/anon/pen/qNybqN.

Replay

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:

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

 <button class="btn btn-default" data-to="mailto:[email protected]|doe|.|org" onclick="document.location=this.dataset.to.replace(/\|/g, '')">
   E-Mail
 </button>

Look at http://jsbin.com/takesixazu/edit?html,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

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

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