Forum Moderators: open
<script language=javascript>
<!--
function mref() {
temp = "fakeaddress@someurl.com?" +
"subject=My%20Subject";
temp = "mailto:" + temp;
mymail.href=temp;
return true;
}
// -->
</script>
<P><a name="mymail" href="#" onclick="mref()"><img
src="mailimage.gif" alt="e-MAIL" align="right"></a>
mymail.href=temp;
while IE and Opera process this statement. Strange.
<script language=javascript>
function mref(which) {
temp = "fakeaddress@someurl.com?" + "subject=My%20Subject";
temp = "mailto:" + temp;
which.href=temp;
//return true;
}
</script>
<a href="#" onmousedown="mref(this)"><img src="mailimage.gif" alt="e-MAIL" align="right"></a>
I use onmousedown instead of onclick to make sure that the href is set before the link is actually clicked. Also, I pass "this" as an identifier to the function.