Is there a need for the same DOM element to be refreshed multiple time with the same data?
Can you use a different approach, maybe append to the element instead of replacing? When you talk about 10+ pages and reloading the same element. How much data are you actually inserting each time? The browser garbage collection should be good enough to handle your case. Are you doing any kind of binding to the objects that are inserted? Creating closures with DOM elements will create memory leaks. Maybe this will put your mind at ease. Think of GMail. They are constantly replacing DOM elements and refreshing content. They rely heavily on the browsers automatic garbage collection. On Tue, Dec 16, 2008 at 11:46 AM, Xeoncross <[email protected]> wrote: > > > > On Dec 11, 10:45 am, aowie <[email protected]> wrote: > > Why not define a variable in the JS your loading? Then when you go to > > make the request again, before the JS is loaded, check for that > > variable's existence. If it is defined, dont reload the js, if it > > isnt, let the user continue on their merry way without constantly > > reloading the same JS files. > > > No the problem isn't that I keep re-loading a JS file - the problem > is > that a DOM element (I keep attaching a lot of objects too) is removed > every ajax request and a new (identical) version is added (sometimes). > > So this means that everytime the new AJAX content comes in I have > to rescan for the element and reattach all this stuff to it. - So I > am > worried that after 10+ pages of this I will have a lot of wasted RAM.
