1
我一直在試圖將一些XML內容傳遞給使用以下技術一個新的瀏覽器窗口:在JavaScript中,如何用XML替換窗口的全部內容?
var newWindow = window.open('', '_blank');
newWindow.document.clear();
newWindow.document.open();
newWindow.document.write(xmlString);
newWindow.document.close();
然而,XML被放在裏面<body></body>
標籤的新窗口。
如何讓我的xml文檔代表窗口的全部內容(沒有<html></html>
標籤)?
[相關](http://stackoverflow.com/questions/5581592/render-xml-document-obtained-through-ajax-call-to-a-new-window) – 2015-03-18 21:35:52
@SterlingArcher完美:http:// jsfiddle.net/1sh9tyq9/(不要忘記允許彈出窗口) – blex 2015-03-18 21:38:29
@SterlingArcher - 謝謝,我已經看到了這個問題,但是,只有在我找出如何讓''標籤消失後纔會變得相關。一旦我得到這個問題的答案,它就是第二步。 ;) – Troy 2015-03-18 21:38:50