Dynamic anchor tag problem "@ OR @" causing function to failin IE

C

CES

All,

Could someone please look at this and tell me what's wrong... the function works properly in FireFox but in IE onmouseover it replaces the innerHTML. So the original html:

at (e-mail address removed) Thank you for your consideration.

becomes

at mailto:[email protected]:?SUBJECT=Request for additional information - Package id : /*JS var*/ Thank you for your consideration.

I know the problem is the @ sign because if I remove it the function works properly, but even encoding it doesn’t seem to work I get the same issue.

Any Help would be appreciated Thanks in advance - CES


XXXXXXXXXXXXXXXXX


function mailTO(sender){
document.getElementById('id_' + sender).setAttribute("href", "mailto:info" + "@" + "test.com:?SUBJECT=Request for additional information - Package id : ");
}

<a id="id_emailMe2" class="noExpandNormal" href="#" onmouseover="mailTO('emailMe2')">[email protected]</a>
 
B

BootNic

CES said:
All,

Could someone please look at this and tell me what's wrong... the
function works properly in FireFox but in IE onmouseover it replaces
the innerHTML. So the original html:

at (e-mail address removed) Thank you for your consideration.

becomes

at mailto:[email protected]:?SUBJECT=Request for additional information -
Package id : /*JS var*/ Thank you for your consideration.

I know the problem is the @ sign because if I remove it the function
works properly, but even encoding it doesn’t seem to work I get the
same issue.

Any Help would be appreciated Thanks in advance - CES


XXXXXXXXXXXXXXXXX


function mailTO(sender){
document.getElementById('id_' + sender).setAttribute("href",
"mailto:info" + "@" + "test.com:?SUBJECT=Request for additional
information - Package id : "); }

<a id="id_emailMe2" class="noExpandNormal" href="#"
onmouseover="mailTO('emailMe2')">[email protected]</a>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 //EN">
<html>
<head>
<title>
Untitled
</title>
<script type="text/javascript">
var sucker = "mailto:[email protected]:?SUBJECT=Request for additional information - Package id :"
function mailTO(sender){
sender.setAttribute("href", sucker);
}
</script>
</head>
<body>
<a href="#" onmouseover="this.href=sucker" onmouseout=
"this.href='#'"><span>[email protected]</span></a>
<br>
<a href="#" onmouseover="this.href=sucker" onmouseout=
"this.href='#'">Info</a>
<br>
<a id="id_emailMe2" class="noExpandNormal" href="#" onmouseover=
"mailTO(this)"><span>[email protected]</span></a>
</body>
</html>
 

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,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top