wdolson
September 23rd, 2006, 07:41 AM
I've posted on the C++ forum before, but this is one of the few times I've had to venture into web programming and I've gotten a bit lost...
What I am attempting to do is make e-mail addresses on a site protected from spammers with a javascript. Searching the web, it looks like there are many variations on the technique I'm using. The twist is that our web developer wants to tie the e-mail link to a hotspot on a graphic.
Here is the script:
<script language="JavaScript" type="text/javascript">
function safemail(emailN, emailD, emailT) {
emailN=(emailN + '@' + emailD)
if(!emailT)
{ emailT = emailN}
document.write("<a href=\"mailto:" + emailN + "\">" + emailT + '')
}
</script>
<noscript>
You must have javascript enabled for this to work.
</noscript>
The bit that calls the script is:
<area shape="circle" coords="93,58,47" href="javascript:safemail('sales', 'sol-software.com')">
What this does is go to a new page with the e-mail link as the only item on the page. If you click on the link, it will bring up the e-mail compose window. How can I get this to open the e-mail compose window without going to the extra page?
Thanks in advance,
Bill
What I am attempting to do is make e-mail addresses on a site protected from spammers with a javascript. Searching the web, it looks like there are many variations on the technique I'm using. The twist is that our web developer wants to tie the e-mail link to a hotspot on a graphic.
Here is the script:
<script language="JavaScript" type="text/javascript">
function safemail(emailN, emailD, emailT) {
emailN=(emailN + '@' + emailD)
if(!emailT)
{ emailT = emailN}
document.write("<a href=\"mailto:" + emailN + "\">" + emailT + '')
}
</script>
<noscript>
You must have javascript enabled for this to work.
</noscript>
The bit that calls the script is:
<area shape="circle" coords="93,58,47" href="javascript:safemail('sales', 'sol-software.com')">
What this does is go to a new page with the e-mail link as the only item on the page. If you click on the link, it will bring up the e-mail compose window. How can I get this to open the e-mail compose window without going to the extra page?
Thanks in advance,
Bill