Reputation: 80
I am having a problem. The following javascript works in Firefox, but is returning nothing is IE and Chrome (both latest versions)
var document_copy = document.cloneNode(true);
console.log(document_copy);
I am trying to clone the entire html document.
Am I doing something completely wrong?
Update: @CBroe came up with a work around using
document.documentElement.cloneNode(true);
Upvotes: 2
Views: 1059
Reputation: 96407
I am trying to clone the entire html document.
Clone the html
node instead – document.documentElement.cloneNode(true)
Upvotes: 2
Reputation: 196217
IE 10 works fine for me
For chrome it is not implemented yet (since it was implementation dependent, they chose not to support it).
See http://code.google.com/p/chromium/issues/detail?id=258146
Upvotes: 2