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

I use similar approach, and yes, it works fine as long as spammers don't figure how to extract your email address from JavaScript code.

function em(e2, e1) { return 'mailto:' + e1 + '@' + e2 + '.com'; }

... and somewhere in your HTML code:

onClick="this.href=em('foobar', 'contact')"

The name of the function may be more cryptic and I just thought it may be even dynamic (random), as well as the order of arguments.



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

Search: