I'm trying to add content to the current XUL document from another XML
document. The code looks like :
replaceSubtree: function(content, targetDoc, id) {
var node = targetDoc.getElementById(id);
var newNode = content.cloneNode(true);
node.parentNode.replaceChild(targetDoc.importNode(newNode, true), node);
}
It works visually, but I'm getting errors in the console (using a debug
build) :
###!!! ASSERTION: Already have a document. Unbind first!:
'!GetCurrentDoc() && !IsInDoc()', file nsGenericDOMDataNode.cpp, line 588
And oncommand event are not dispatched :
JavaScript error: , line 0: uncaught exception: Permission denied to get
property ChromeWindow.onDoUpdate()
Any help appreciated !
Fabrice