rem: var body = document.getElementsByTagName('body')[0]; var newScript; node.innerHTML += innerHTML; self.traverse( node, function(node) { if (node.tagName == 'SCRIPT') { newScript = document.createElement('SCRIPT'); newScript.setAttribute('src', node.getAttribute('src')); newScript.text = node.text; node.parentNode.removeChild(node); body.appendChild(newScript); } return Divmod.Runtime.Platform.DOM_DESCEND; }); 
add: var head = document.getElementsByTagName('head').item(0); var doc = self.parseXHTMLString(innerHTML); var scripts = doc.getElementsByTagName('script');  for(var i = 0;i < scripts.length;i++){ var oldScript = scripts[i].parentNode.removeChild(scripts[i]); var src = oldScript.getAttribute('src'); var text = oldScript.text; var script = document.createElement('script'); script.type = 'text/javascript'; if(src != '' && src != null){ script.src = src; } else if(text != '' && text != null){ script.text = text; } head.appendChild(script); }  node.innerHTML += doc.xml; 
context:     function appendNodeContent(self, node, innerHTML) {        var body = document.getElementsByTagName('body')[0];        var newScript;        node.innerHTML += innerHTML;        self.traverse(            node,            function(node) {                if (node.tagName == 'SCRIPT') {                    newScript = document.createElement('SCRIPT');                    newScript.setAttribute('src', node.getAttribute('src'));                    newScript.text = node.text;                    node.parentNode.removeChild(node);                    body.appendChild(newScript);                }                return Divmod.Runtime.Platform.DOM_DESCEND;            });    },
meta: 1565	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1565/c77c1203f212a6755720fc5032411374bd260b37/runtime.js/buggy/nevow/runtime.js