javascript in firefox fine but in IE it chokes on a long string??

M

mike

both of these lines below do not work in IE. In the first I replaced
" with "" and in the second I replaced " with '. Is there some trick
to composing long strings in IE?

Thanks,
Mike


theLayer.innerHTML= "<table border=""0"" width=""250""
bgcolor=""#424242"" cellspacing=""0"" cellpadding=""5""><tr><td
width=""100%""><table border=""0"" width=""100%"" cellspacing=""0""
cellpadding=""0"" height=""36""><tr><td id=""titleBar""
style=""cursor:move"" width=""100%""><ilayer width=""100%""
onSelectStart=""return false""><layer width=""100%""
onMouseover=""isHot=true;if (isN4) ddN4(theLayer)""
onMouseout=""isHot=false""><font face=""Arial""
color=""#FFFFFF"">Comments</font> </layer> </ilayer> </td> <td
style=""cursor:hand"" valign=""top""><a href=""#"" style=""text-
decoration:none"" onClick=""hideMe();return false""><font
color=#ffffff size=2 face=verdana>X</font></a></td></tr><tr><td
width=""100%"" bgcolor=""#FFFFFF"" style=""padding:4px""
colspan=""2"">" + xmlHttp.responseText + "</td></tr></table></td></
tr></table>";

theLayer.innerHTML= "<table border='0' width='250' bgcolor='#424242'
cellspacing='0' cellpadding='5'><tr><td width='100%'><table border='0'
width='100%' cellspacing='0' cellpadding='0' height='36'><tr><td
id='titleBar' style='cursor:move' width='100%'><ilayer width='100%'
onSelectStart='return false'><layer width='100%'
onMouseover='isHot=true;if (isN4) ddN4(theLayer)'
onMouseout='isHot=false'><font face='Arial' color='#FFFFFF'>Comments</
font> </layer> </ilayer> </td> <td style='cursor:hand'
valign='top'><a href='#' style='text-decoration:none'
onClick='hideMe();return false'><font color=#ffffff size=2
face=verdana>X</font></a></td></tr><tr><td width='100%'
bgcolor='#FFFFFF' style='padding:4px' colspan='2'>" +
xmlHttp.responseText + "</td></tr></table></td></tr></table>";
 
S

Stevo

mike said:
both of these lines below do not work in IE. In the first I replaced
" with "" and in the second I replaced " with '. Is there some trick
to composing long strings in IE?

Thanks,
Mike

theLayer.innerHTML= "<table border='0' width='250' bgcolor='#424242'
cellspacing='0' cellpadding='5'><tr><td width='100%'><table border='0'
width='100%' cellspacing='0' cellpadding='0' height='36'><tr><td
id='titleBar' style='cursor:move' width='100%'><ilayer width='100%'
onSelectStart='return false'><layer width='100%'
onMouseover='isHot=true;if (isN4) ddN4(theLayer)'
onMouseout='isHot=false'><font face='Arial' color='#FFFFFF'>Comments</
font> </layer> </ilayer> </td> <td style='cursor:hand'
valign='top'><a href='#' style='text-decoration:none'
onClick='hideMe();return false'><font color=#ffffff size=2
face=verdana>X</font></a></td></tr><tr><td width='100%'
bgcolor='#FFFFFF' style='padding:4px' colspan='2'>" +
xmlHttp.responseText + "</td></tr></table></td></tr></table>";

The single quote version should work. What's the problem with that?

btw, I think there's only about 5 people in the world still using
netscape 4 and they're all in mental homes ;-)
 
M

mike

I get:
A Runtime Error has occurred. Do you wish to debug?

Line: 164
Error: Unknown runtime error

I found a clue. I am using ajax and receiving data back from the
server in javascript using xmlHttp.responseText

The problem is I am trying to change the innerHTML of a DIV to include
a form sent back in the html like so:

<form name="myform" id="myform">
</form>

as soon as I put the form in the html code to send back, I get that
error. Any ideas how to get around this problem?
 

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,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top