Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What about this one? I think I found it in a Stack Overflow answer a year or two ago. I've used it, but haven't tested it for effectiveness in avoiding spam.

<a href="#" class="cryptedmail" data-name="david" data-domain="davidlane" data-tld="io" onclick="window.location.href = 'mailto:' + this.dataset.name + '@' + this.dataset.domain + '.' + this.dataset.tld; return false;"></a>

Paired with this CSS:

.cryptedmail:after { content: attr(data-name) "@" attr(data-domain) "." attr(data-tld); }

Which results in a clickable link that opens whatever is set up to handle mailto: links (1).

1: https://nexus.armylane.com/files/email-crypted.png



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: