Which one is the safest to protect against memory leak

I have a table of frequently updated information. This is represented using a div container with a div for each row, each row contains 10 divs.

I use setInterval to call the asmx web service, which returns some formatted json information.

In the success callback, I call $("#myContainer").empty();in the container div and recreate the rows and 10 nested divs for each column of the row.

This page can be continued for a whole day, so I am afraid of updating the DOM like this, since I noticed that browser memory grows over time (IE8).

Another approach that I am considering is to add id to the div line. When new results process each data element, find the corresponding row, if it exists, overwrite the data in each div. If it does not exist (new data, for example), add a line.

What approaches are used by other people for this kind of long-term display of information in real time in real time.

TIA

+5
source share
2 answers

, - DOM. , , DOM , AJAX.

+5

.

+1

All Articles