For debugging purpose, I need to create an new xml document popup to display the (x)html source structure of my current document.
But the following code does not work:
var w = window.open();
w.document.open('text/xml');
w.document.write(window.document.documentElement.innerHTML);
w.document.close();
开发者_开发问答
It seems that document.open()
does not accept contentType anymore.
Just put a textarea in your existing page and copy the innerHTML into the textarea.
精彩评论