[Javascript] Re: How to make IE display changes to DOM tree?
Peter Brunone
peter at brunone.com
Mon Dec 13 08:11:12 CST 2004
> Does anyone have any recommendations for good, up-to-date
> books or sites for all this sort of thing?
I don't know, but if you find one, pass it on. I love the MSDN
reference for IE, but so far I have found *nothing* comparable for the
standards (or even just one other browser).
-----Original Message-----
From: javascript-bounces at LaTech.edu On Behalf Of Matthew Palmer
On Sun, Dec 12, 2004 at 10:33:47PM -0600, Peter Brunone wrote:
> I tried your script and it didn't work for me either. For what
I found the problem: The IE DOM adds an extra level of object inside the
TABLE -- TBODY. You need to appendChild to the TBODY, not the TABLE.
So, for instance:
row = document.createElement('TR');
tbl = document.getElementById("DynamicTable");
// Mozilla-compatible
tbl.appendChild(row);
// But for IE:
tbl.childNodes.item(0).appendChild(row);
> it's worth, when I want to add table rows in IE, I use the insertRow()
> and insertCell() methods of the table and tr, respectively. You can
Son of a *****! It's not even IE-specific -- it's in the W3C HTML DOM
version 2. Aaaargh!
Thanks for the pointer, Peter -- I've found the relevant spec now, so
hopefully I should be able to write things a little simpler from now
on...
Does anyone have any recommendations for good, up-to-date books or sites
for all this sort of thing? The W3C specs, whilst good, aren't exactly
the most approachable sorts of things...
- Matt
More information about the Javascript
mailing list