Forum Moderators: open
It works like this:
In the page code there is a reference to an external js file:
<script type="text/javascript" language="JavaScript" src="hidem.js"></script>
The hidem.js file reads as follows:
<!-- Begin
userpart1 = "te";
userpart2 = "st";
sitepart1 = "dom";
sitepart2 = "ain.com";
document.write('<a h' + 'ref="m' + 'ailt' + 'o:' + userpart1 + userpart2 + '@' + sitepart1 + sitepart2 + '\">');
document.write('<img style="position:relative; top:3px" src="image-of-email-address.gif" border="0" height="15" width="165" alt="spam-protected clickable email address">' + '</a>');
// End -->
As you can see the code breaks up the email address into segements and displays an image of the email address. Pretty bulletproof, but also Firefox proof now! :-(
Any help appreciated. Thanks
<script type="text/javascript">
<!--
var username = "enquiries";
var hostname = "yoursite.co.uk";
var linktext = username + "@" + hostname;
document.write("<a href=" + "mail" + "to:" + username + "@" + hostname + " title=" + linktext + ">" + linktext + "</a>");
//-->
</script>
Sorry what had happened is I had mistakenly switched Javascript off in my version of Firefox! (via the web developer tools plugin)
Anyway hope someone finds the script useful for themselves.
Not sure whether it is necessary to go so far as to display an image of the email address instead of text, but I do that anyway for ultimate bullet-proofing!
Cheers
[webmasterworld.com...]