Mangle2 is a javascript function that takes human readable, but spam-proof representation of an email address and replaces it with a mailto link which gets populated with real address when mouse pointer moves over it.

This is a more safe, but less friendly version of my previous script. Both work, for now, since email harvest bots don't have a javascript interpreter for performance reasons and can only see the human readable, but spam-proof form. However, sooner or later such bots will appear and when they do, this script will make it a bit more difficult to read.

Demonstration

Alternative version of 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, 8.5.2006

My random Marela picture
Random image from my collection on Marela