Alohci is right: there's not much of a difference, since web compatibility forced the browsers to implicitly adoptNode()
before inserting a node into another document.
Before you insert the cloned node into a new document, there's a difference: the owner document of the node returned by the cloneNode(original)
is the same as of the original node, and the new document if you call newDocument.importNode(original)
. You can see this difference if you use ownerDocument
or related properties (such as baseURI).
But if you call importNode on the same document that the original node belongs to, there's no difference whatsoever.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…