[英]Refresh a newly opened window.open from the about:blank
我從ajax結果獲取數據后打開一個窗口。 僅當我調整窗口大小(手動熱點調整大小)時,以下腳本才會在新窗口中打開pdf,否則不會顯示pdf查看器。
如何制作要在其彈出窗口中顯示的內容
window.open("about:blank")
.document.write(`
<html>
<head>
<style>
body {
margin: 0
}
</style>
</head>
<body>
<iframe id="iframe" src="' + data + '" scrolling="auto" frameborder="0px" marginheight="0px" marginwidth="0px" height="100%" width="100%">
</iframe>
</body>
</html>
`);
我用aboutblank代替about:blank效果很好。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.