[thelist] JS hiding email address
Liorean
liorean at user.bip.net
Fri Mar 7 19:02:00 CST 2003
Sarah wrote:
> > If this is only a temporary thing will turning the @ into ascii
> > not suffice?
> >
> > eg; test at domain.com = test@domain.com
>
> I've also been looking for options for "hiding" email addresses on my site,
> and this sounds like a promising idea (and it doesn't use JavaScript, which
> is good). Does anyone know if it would be successful at hiding the email
> address from bots?
There are url-decoding bots. I've never seen one with xml/html entities
decoding.
But, for security, why not combine them?
~~~~@~~~~
var mail='mailto:liorean at user.bip.net';
mail=(function(){
var s='',i=0;
for(;i<mail.length;)
s+='%'+mail.charCodeAt(i++).toString(16);
return s
})();
// Results:
#0037;6d%61%69%6c%74%6f%3a%6c%69%6f%72%65%61%6e%40%75%73%65%72%2e%62%69%70%2e%6e%65%74
// Hmm, on a second thought, they might get a bit long.
~~~~@~~~~
That way, they have to have a parser able to not only parse the entity
that corresponds to '@', but '%', and then afterward apply url decoding
(the order a browser should be doing it).
Or you could use some coding scheme like:
[plain,urlenc,plain,htmlent][...repeat...]
--
liorean <mailto:liorean at user.bip.net>
ViewStyles, ViewScripts, ToggleStyles and GraphicsInfo bookmarklets and
Theme Switcher, Cookies Handler scripts:
<http://liorean.web-graphics.com/>
More information about the thelist
mailing list