[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


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:

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

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:

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;

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

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?


var me = tom.pixelmech.webDeveloper();

[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

More information about the thelist mailing list