Created
August 4, 2014 03:12
-
-
Save maxbeatty/e840e43aca67a82cc413 to your computer and use it in GitHub Desktop.
How I'm obfuscating email addresses in 2014
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p> | |
<strong>First Last</strong> whatever. | |
</p> | |
<a href="javascript:void(0)" class="pick-me">Email Me</a> | |
<script> | |
// sets href to "mailto:[email protected]" | |
document.querySelector('.pick-me').onclick = function (e) { | |
this.href = [ | |
':otliam'.split('').reverse().join(''), | |
document.querySelector('p strong').textContent.toLowerCase().replace(/\s/, ''), | |
'@', 'domain.com'].join('') | |
] | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment