This project's DOM tree is big and nodes must be created dynamically. There are 2 ways:
1) insert child element in parent as string and let the browser infer the child, i.e.
html:
<div id="parent"></div>
and javascript:
str='<input type="text" id="child" size="30">';
documen.getElementById("parent").innerHTML=str;
2) have js create the child, i.e.
parentElement=document.getElementById('parent');
childElement=document.createElement('input');
childElement.setAttribute('id','child');
parentElement.appendChild('childElement);
I've been using 1, and started getting very strange behavior when the tree got BIG and the application data got BIG. Like, e.g.
aValue="hi";
str='<input type="text" id="child" size="30" value='+aValue+'>';
documen.getElementById("parent").innerHTML=str;
The result would be a text line input element containing hi, and a few more added elements to DOM tree and data to app data, and all of a sudden the text line would read
+aValue+
And say under chrome debugger you'd see no causal relationship with said result. I tried removing previous children then inserting new children, it had no effect. Also, I get the same exact behavior in chrome, ff and opera. So it seems memory is getting corrupted in the common core browser c++ code.
So the question is: has anyone developed a stable BIG web app (order 100k lines) with BIG dynamic DOM Tree (order of 1000 nodes) and BIG app data (order of many Megs). If so, exactly what method of Dynamic DOM Node creation have you used. Any other tips with regards to memory management would be appreciated.