M
m0nkeymafia
I have spent the past few weeks trying to figure a way around this
problem, and have yet to find a good enough solution.
Internet Explorer leaks memory when I update a div container using
innerHTML, this does not occur in firefox. This would not be a problem
except the webpage is required to be left on for weeks on end without
being restarted. I presume the issue with innerHTML is that Internet
Explorer apparently parses what you give it and then decides on how to
construct the dom elements itself, so never truely creates what you
give it.
I know that the innerHTML is the problem as I have successfully
narrowed down the leak to that line. It only leaks memory when I assign
content to the innerHTML of my containing DIV. Appending a text node,
for example, with the exact same information to the same div does not
leak. Note I have also tried using such existing AJAX packages like
Prototype etc. but to no avail.
I need to do it this way as my XML documents are styled using an XSL
stylesheet and then transformed using transformNode [I will omit
details regarding firefox as there is no problem there]. I have looked
into transformNodeToObject as a way to get a dom object that I
originally assumed could be appended [as a child] to my containing
element. This did not work and gave me compatibility errors.
I suppose I am either looking for someone who has solved this problem,
or who has an acceptable work around. Or someone to say that it cannot
be solved.
I thank anyone in advance who attempts to help me. If you can help me
it would be GREATLY appreciated.
Below is a snippet of the final code I am using.
document.getElementById(container) = null;
output = http.responseXML.transformNode(xslProc);
if (output)
{
document.getElementById(container).innerHTML = output;
}
output = null;
problem, and have yet to find a good enough solution.
Internet Explorer leaks memory when I update a div container using
innerHTML, this does not occur in firefox. This would not be a problem
except the webpage is required to be left on for weeks on end without
being restarted. I presume the issue with innerHTML is that Internet
Explorer apparently parses what you give it and then decides on how to
construct the dom elements itself, so never truely creates what you
give it.
I know that the innerHTML is the problem as I have successfully
narrowed down the leak to that line. It only leaks memory when I assign
content to the innerHTML of my containing DIV. Appending a text node,
for example, with the exact same information to the same div does not
leak. Note I have also tried using such existing AJAX packages like
Prototype etc. but to no avail.
I need to do it this way as my XML documents are styled using an XSL
stylesheet and then transformed using transformNode [I will omit
details regarding firefox as there is no problem there]. I have looked
into transformNodeToObject as a way to get a dom object that I
originally assumed could be appended [as a child] to my containing
element. This did not work and gave me compatibility errors.
I suppose I am either looking for someone who has solved this problem,
or who has an acceptable work around. Or someone to say that it cannot
be solved.
I thank anyone in advance who attempts to help me. If you can help me
it would be GREATLY appreciated.
Below is a snippet of the final code I am using.
document.getElementById(container) = null;
output = http.responseXML.transformNode(xslProc);
if (output)
{
document.getElementById(container).innerHTML = output;
}
output = null;