Forum Moderators: open

Message Too Old, No Replies

Can spambots read javascript?

trying to hide email addresses

         

proboscis

11:20 pm on Jul 5, 2006 (gmt 0)

10+ Year Member



Lots of outdated info out there...so these days can javascript hide email addresses or not?

adni18

12:04 am on Jul 6, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



theoretically, anything can read email addresses, even ones in images.

proboscis

2:33 am on Jul 6, 2006 (gmt 0)

10+ Year Member



Well, let's say I replaced all my email addresses with this:

var username = "test";
var hostname = "example.com";
var linktext = "Send Email";
document.write("<a href=" + "mail" + "to:" + username +
"@" + hostname + ">" + linktext + "</a>")

Would I be wasting my time?

adni18

1:01 pm on Jul 6, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nah, most bots can't read that, but if your user doesn't have javascript on, then you're out of luck.

kaled

1:52 pm on Jul 6, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Use a gif that displays the email address and a static link that simply has href="mailto:". You can use javascript to adjust the href value but if javascript is turned off, it still works but the user has to set the to: value manually.

Kaled.

penders

12:36 am on Jul 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



...most bots can't read that...

Must admit, I've gotten a bit paranoid these days with robots getting my email address. I have previously 'hidden' my email address with various javascript, but it only takes one clever script... and besides, they've gotten my address some how!

I tend to use just an image, and no anchors or mailto: links in sight!

I suppose you could use js that waits a second or two, after the page has loaded, before completing the <a> tags, and even then you should call another js function.... maybe.

Use a form instead!

Trust no one! :o