Mangle is a javascript function that takes human readable, but spam-proof representation of an email address and replaces it with a mailto link.

This works, because email harvest bots don't have a javascript interpreter for perfomance reasons and can only see the human readable, but spam-proof form. So far I haven't received a single spam message on addresses that were displayed ONLY when protected with this function.

Demonstration

My very own homepage.

Usage

Import javascript function in your preferred way and call it after the page has been loaded. It will search for all elements of the form:
<span class="change">billg at microsoft dot com</span> and change them into a mailto link.

What it does is find elements with class set to change and replace them with a mailto link by changing words at with @ and dot with a dot.

Requirements

Obviously a Javascript capable browser with this feature turned on. Since there are so many of them, each with their own personal quirks, I tested this code and it works on:

  • Internet Explorer 5.0+
  • Firefox 1.0+
  • Safari 1.3+
  • Opera 8.0+

Downloads

You can download the latest version here.

Bugs & limitations

  • none known

Questions

If you have any questions not answered here, please contact me or leave a comment on my blog.

License

MIT license. I'd love to hear from anyone using my code, but you're not obliged to do so.

Marko Samastur, 3.3.2006

My random Marela picture
Random image from my collection on Marela