I'm a real rube at JavaScript, so I apologize in advance if this question is overly stupid...
I'm workng on a client's new website and am trying to avoid all of the spambots out there by excuting a "mailto" from JavaScript. This wouldn't be much of an issue except that I'm working with an imagemap and I can't figure out how to actually get the "mailto" to fire apropriately.
Here's my html code:
On first pass, this Seems to be working ok in IE, but Mozilla & Netscape open a blank window behind the email client window.
Any help would be appreciated.
Thanks!
I'm workng on a client's new website and am trying to avoid all of the spambots out there by excuting a "mailto" from JavaScript. This wouldn't be much of an issue except that I'm working with an imagemap and I can't figure out how to actually get the "mailto" to fire apropriately.
Here's my html code:
Code:
<td width="365" valign="top"><img src="images/header_right.gif" width="365" height="188" usemap="#emailtest" border="0" />
<map name="emailtest" id="emailtest">
<area shape="rect" coords="180,91,354,110" alt="Email Us!" href="javascript:emailMap();" />
</map>
And here's the javascript (substitute some real domain name for "clientdomainname" below):
<script type="text/JavaScript">
function emailMap(){
var first = 'ma';
var second = 'il';
var third = 'to:';
var address = 'jim';
var domain = 'clientdomainname';
var ext = 'com';
outstring = "";
outstring = outstring+first+second+third;
outstring = outstring+address;
outstring = outstring + '@';
outstring = outstring + domain;
outstring = outstring+'.';
outstring = outstring+ext;
window.open(outstring);
}
</script>
On first pass, this Seems to be working ok in IE, but Mozilla & Netscape open a blank window behind the email client window.
Any help would be appreciated.
Thanks!