开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜