adoptNode 和 importNode 的区别
Differences between adoptNode and importNode
JavaScript 中文档对象的 importNode
和 adoptNode
有什么区别?
您可以将 adoptNode
视为 "move",将 importNode
视为 "copy"。
w3schools adoptNode()
参考:
Note: The original node (and its child nodes, if any) is removed from the other document.
w3schools importNode()
参考:
Note: The original node is not removed from the other document. The imported node is a copy of the original.
注意importNode()
中的deep
参数。
JavaScript 中文档对象的 importNode
和 adoptNode
有什么区别?
您可以将 adoptNode
视为 "move",将 importNode
视为 "copy"。
w3schools adoptNode()
参考:
Note: The original node (and its child nodes, if any) is removed from the other document.
w3schools importNode()
参考:
Note: The original node is not removed from the other document. The imported node is a copy of the original.
注意importNode()
中的deep
参数。