My other email obfuscation methods try to hide the address in the body of the document. This one has the email in plain sight all the time. This is also different in that it doesn't have to be customized. It relies on the fact that many URL (web addresses) are in the form of http://www.domain/~username/ and that the corresponding email address is username@domain.
Of course, this fact is probably known to spammers so I would suspect that someone will eventually build (if they haven't already) a harvester that will extract addresses this way. Even if they do adding this script to your page will not make a difference in whether your email is harvested.
Copy the following code into a file such as email.js Or save email.js directly
// eMail Reconstructor Script 1.0 by Tim Williams - freeware
// get the host and path names from the current URL
var host = location.hostname
var path = location.pathname
// if host begins with www. remove the www.
var domain = host.replace(/www./i,"");
// find the ~ and you find the username
var username = path.substring(path.indexOf("~")+1,path.indexOf("/",path.indexOf("~")))
document.write ("<a href='mailto:" + username + "@" + domain + "'>" + username + "@" + domain+ "</a>");
Then insert the following HTML into your documents.
<script src="email.js" type="text/javascript" language="javascript">
</script>
<noscript>
To email me, either enable JavaScript; or try <i>username</i>@<i>domain</i>,
where my username is just after the tilde "~", and the domain is just after
the http://www. part of the current URL (webpage address).
</noscript>