ah well, thought I'd try to learn something new but,, document.getElementsById('tray').innerHTML=""
works well enough. I don't know, firefox crashes more often than IE on some of my inventions.
So, Mrhoo, would that be a better way to do it than innerHTML="" ?
I put in a button to alert(document.images.length)
and I get expected results. Is there memory leak or, why would innerHTML="" be an inferior way to do it?
BTW, my project keeps moving along,, I'm just wishing to employ a whole lot of DOM stuff that I've not bothered with before like,
I wanted to set an onload function and tried this after appendChild(node)
node.setAttribute(attributename, value, [iecaseflag])
But, couldn't get it to work and it was easier to to have document.write('<img src="'+Q[i]+'" onload="nextFunc()"> ')
So I dunno. Guess I'm stuck with methods that will not be supported someday?
On the contrary, those methods (DOM methods) are the modern one. Can we see you code? Should work, unless you were made a mistake.
innerHTML could be also an alternative. But it depends on the aim of your code. innerHTML is not a standard DOM method and it does not insert always all the elements and their attributes into the DOM tree. If you need a simple display of new elements (and no further DOM manipulation) you may use innerHTML. Otherwise you are forced to use DOM methods.
Bookmarks