Click to See Complete Forum and Search --> : spambot countermeasure help
twonames
03-20-2003, 03:40 PM
I'm trying and failing to use the spambot countermeasure in the way I want.
I can use it ok to put an email address which will appear on the page as "a@bc.com" That works fine.
What I want is for the link on the page to appear as "Email Andy".
I've tried to embed the script in the <a> tag but it's not playing ball.
Any suggestions?
AdamBrill
03-20-2003, 03:59 PM
Is this what you want?
<a href="mailto:a@bc.com">Email Andy</a>
twonames
03-20-2003, 04:10 PM
YES! but I want to replace the "A@BC.COM" with the javascript which hides the address from spambots.
You can guess what's prompting me to try to do it I bet!
AdamBrill
03-20-2003, 04:17 PM
Well, you could try this. Put this in the head:
function email(){
document.location="mailto:a@bc.com";
}
And the link would be like this:
<a href="#" onclick="email(); return false;">E-mail Andy</a>
I'm not sure if that would help or not, but it would be worth a try. I've never heard of that being a problem... Is it really that much of a problem for you??
twonames
03-20-2003, 04:32 PM
Just thinking is a problem ath the mo!
Maybe I'm not being clear in what I'm trying to do or maybe your answer is exactly what I need but I'm too much of a javascript virgin to spot it.
I got this script...
<script language="JavaScript"><!--
// hide script
var sb_domain = "aol.com"
var sb_user = "joe8625"
var sb_recipient = sb_user + "@" + sb_domain
var sb_url = "mailto:" + sb_recipient
document.write(sb_recipient.link(sb_url));
// --></script>
and this puts an email link on the web page which appears as "joe8625@aol.com"
I want to do something a little different. I want "Email Andy" to appear on the page and the underlying link to be "mailto:squire@westminstermorris.org" (yes, I'm a morris dancer. Don't judge me too harshly)
The point of using the script is to stop the email addresses from being harvested.
Am I making sense yet?
Thanks
AdamBrill
03-20-2003, 04:42 PM
Change the function form what I had to this:
function email(){
document.location="mailto:squire@"+"westminstermorris.org";
}
I can't really check, but I think that would take care of most of your problems. The "+" in there should make it so the programs won't find it...
twonames
03-20-2003, 05:37 PM
HANG ON - Spotted it!
Explaining the problem to "She who would like to be obeyed" I could see what I needed.
Looking at the sample script, I set
sb_url to be "Mailto:" + sb_user + "@" + sb_domain
sb_recipient to be "Mail Andy" rather than sb_user + "@" + sb_url
I think it'll work.
If only I'd looked a little deeper.
Thanks for the help though.