[thelist] "Unknown Runtime Error" in IE5 for my JS..grrr

Tom Dell'Aringa pixelmech at yahoo.com
Thu Apr 3 10:30:44 CST 2003


Heyo,

This is driving me NUTS. I'm doing a simple innerHTML test to get
some code to work in IE5+ and NS6+. I have a plain html file that
opens a window - below is that file:

=========================
<html><head>
<script>
function win()
{
window.open("addtest.html","add","resizable=yes, status=yes,
width=400, height=300");
}
</script>
</head>
<body>
<table name="t1" id="t1">
<tbody id="t1body">
<tr>
   <td>test</td>
</tr>
</tbody>
</table>
<a href="javascript: win()">launch win</a>
</body></html>
=======================================

Super basic. The opened window is also very simple I am merely trying
to add some innerHTML to the table body to add some rows. Here is
that code:

=======================================
<html><head>
<title>addtest</title>
<script>
var item = 1
function addItem()
{
	target = window.opener;
	
	addHTML = '<tr><td width="15%">Field '+item+'</td><td><input
type="text" name="add'+item+'" value="Added '+item+'"
/></td></tr><tr><td>&nbsp;</td><td><input type="text"
name="label'+item+'" value="Label '+item+'" /></td></tr>';

	body = target.document.getElementById('t1body');
	body.innerHTML += addHTML;
	item += 1;
}
</script>
</head>

<body>
Add Test<br />
<a href="javascript: addItem();">add data</a>
<a href="javascript: self.close()">close window</a>
</body></html>
=============================================

The first time I ran this in IE5.5, I had less code in the addHTML -
but it worked. It works fine in NS6 and NS7.

When I went back to IE I got the "Unknown Runtime Error" - which
really confused me. I tried rolling back to previous code and putting
nothing in the addHTML other than "hi" and same thing. I tried
restarting IE..no help. 

>From my tests it is definitely erroring out on the

body.innerHTML += addHTML;

line. Heck this is an IE thing man! Anyone have any idea what is
going on here? I can't believe this would work one moment and not the
next. Is there some security issue I am missing here?

Tom

=====
http://www.pixelmech.com/
var me = tom.pixelmech.webDeveloper();

http://www.maccaws.com/
[Making A Commercial Case for Adopting Web Standards]

"That's not art, that's just annoying." -- Squidward

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com


More information about the thelist mailing list