xgretsch
03-24-2008, 07:59 PM
I have a page where, on a button-press from the user, I create a table (using Javascript): the table contains a number of buttons (e.g. a "More info" button on each row). I create the table by writing HTML and assigning it to the "innerHTML" value of a placeholder div.
It all works fine, except that (according to drip) this appears to be causing memory leaks. I would therefore like to find these buttons and destroy them when the user exits from the form, or performs a fresh search.
However, none of the usual DOM traversal methods seem to work: findElementsByTagName, findElementById, etc. They find the DOM structure of the original placeholder, and don't seem to be able to spot any of the elements I've newly added.
Firebug can definitely see them, looking exactly as I'd expect. But my own Javascript code can't.
Does anyone have any ideas? Or even a statement of why what I'm doing can't possibly work? They would be much appreciated.
(Take a look at http://www.bachtrack.com/find-a-concert to see the relevant page...).
Thanks
It all works fine, except that (according to drip) this appears to be causing memory leaks. I would therefore like to find these buttons and destroy them when the user exits from the form, or performs a fresh search.
However, none of the usual DOM traversal methods seem to work: findElementsByTagName, findElementById, etc. They find the DOM structure of the original placeholder, and don't seem to be able to spot any of the elements I've newly added.
Firebug can definitely see them, looking exactly as I'd expect. But my own Javascript code can't.
Does anyone have any ideas? Or even a statement of why what I'm doing can't possibly work? They would be much appreciated.
(Take a look at http://www.bachtrack.com/find-a-concert to see the relevant page...).
Thanks