當前位置:
首頁 >
js window.open()实现打印,如何在关闭打印窗口时刷新父窗口
發布時間:2024/9/20
41
豆豆
生活随笔
收集整理的這篇文章主要介紹了
js window.open()实现打印,如何在关闭打印窗口时刷新父窗口
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
var childWin = window.open("your URL"); //獲取子窗口句柄
childWin.onunload = function(){ //onunload是窗口關閉事件
this.opener.location.reload(); //childWin.opener為父窗口,及時刷新
}
樓主也可以這樣:(直接在子窗口中)
window.onunload = function(){
this.opener.location.reload();
}
更為簡潔。。。
childWin.onunload = function(){ //onunload是窗口關閉事件
this.opener.location.reload(); //childWin.opener為父窗口,及時刷新
}
樓主也可以這樣:(直接在子窗口中)
window.onunload = function(){
this.opener.location.reload();
}
更為簡潔。。。
總結
以上是生活随笔為你收集整理的js window.open()实现打印,如何在关闭打印窗口时刷新父窗口的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: lastdance音译歌词播放(last
- 下一篇: 在64位windows下使用instsr