开发者

display an (x)html document structure in a new window

开发者 https://www.devze.com 2023-02-22 14:52 出处:网络
For debugging purpose, I need to create an new xml document popup to display the (x)html source structure of my current document.

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.

Is there any other solution ?


Just put a textarea in your existing page and copy the innerHTML into the textarea.

0

精彩评论

暂无评论...
验证码 换一张
取 消