how can I use javascript to hide an email address with an image link from spambots?

M

Millie

Okay, I'm using this code

<script language=JavaScript>
<!--
var username = "username";
var hostname = "domain.com";
var linktext = "click here to send me email";
document.write("<a href=" + "mail" + "to:" + username +
"@" + hostname + ">" + linktext + "</a>")
//-->

</script>

in an attempt to cut down on the whole spam problem. However, I have
an image link that I would like to use this with. Now, I'm sorry I'm a
newbie at this, so I hope this isn't a stupid question, but what is
the correct code to do this with an image link?

TIA
 
H

Hywel Jenkins

Okay, I'm using this code

<script language=JavaScript>
<!--
var username = "username";
var hostname = "domain.com";
var linktext = "click here to send me email";
document.write("<a href=" + "mail" + "to:" + username +
"@" + hostname + ">" + linktext + "</a>")
//-->

</script>

in an attempt to cut down on the whole spam problem. However, I have
an image link that I would like to use this with. Now, I'm sorry I'm a
newbie at this, so I hope this isn't a stupid question, but what is
the correct code to do this with an image link?
Change
var linktext = "click ...";
to something like
var linktext = "<img src=\"mypic.gif\">";
 
T

Thomas 'PointedEars' Lahn

Millie said:
Okay, I'm using this code

<script language=JavaScript>

[scriptkiddie's bullshit]
in an attempt to cut down on the whole spam problem [...]

and replace it with a usability problem. Great.


PointedEars, wondering why so few people read before they post
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top