
Originally Posted by
Twey
Code:
elements = container.getElementsByTagName('*'); //get all sub elements under the container
Beware! This will work if the container is document, but document.getElementsByTagName() and HTMLElement.prototype.getElementsByTagName() are different! The latter only finds elements that are direct children of the element.
Changed that part as below
Code:
elements = container.childNodes;
for (var i=0; i<elements.length; i++) {
if (elements[i].nodeType==1 && elements[i].getAttribute("langText"))
...
else if (elements[i].hasChildNodes()) //if the element has sub nodes
fillLangTexts(elements[i]); //call to iterate over the sub nodes
I think this is OK now, right?
Bookmarks