R
Razzbar
I'm using the newly discoverd (to me
XMLHttpRequest object to grab
content for a page, then using innerHTML to insert the content, like...
myDiv = document.getElementById('somediv');
myDiv.innerHTML = xmlhttp.responseText;
.... it works fine up to a point. The content I'm inserting is a series
of elements, and so they should be accessable as the myDiv.children[]
array. Indeed they are in IE, but they aren't in Firefox. If I try to
get the myDiv.children.length value, I get a correct answer in IE, but
FF gives me 'undefined'. I'd like to be able to access these nodes for
various purposes.
It seems like FF doesn't 'see' the innerHTML in the document tree (is
that the correct term?).
I haven't tried using appendChild to get the elements into their parent
container, because it seems too inneficient. I'd have to take the
responseText and split it into an array of elements, then iterate and
insert. I'm hoping someone can come up with a way to "shake the tree"
into knowing that myDiv has some children.
? TIA,
content for a page, then using innerHTML to insert the content, like...
myDiv = document.getElementById('somediv');
myDiv.innerHTML = xmlhttp.responseText;
.... it works fine up to a point. The content I'm inserting is a series
of elements, and so they should be accessable as the myDiv.children[]
array. Indeed they are in IE, but they aren't in Firefox. If I try to
get the myDiv.children.length value, I get a correct answer in IE, but
FF gives me 'undefined'. I'd like to be able to access these nodes for
various purposes.
It seems like FF doesn't 'see' the innerHTML in the document tree (is
that the correct term?).
I haven't tried using appendChild to get the elements into their parent
container, because it seems too inneficient. I'd have to take the
responseText and split it into an array of elements, then iterate and
insert. I'm hoping someone can come up with a way to "shake the tree"
into knowing that myDiv has some children.
? TIA,