当前位置:网站首页>JS implements the problem of closing the current child window and refreshing the parent window
JS implements the problem of closing the current child window and refreshing the parent window
2022-07-03 05:44:00 【k678mh】
Add in child window :
<script type="text/javascript">
window.onunload = onbeforeunload_handler;
function onbeforeunload_handler(){
window.opener.location.href = window.opener.location.href;
}
</script>
attach :
onbeforeunload and onunload difference :
onbeforeunload It is also called when the page is refreshed or closed ,onbeforeunload It is called when you are about to go to the server to read a new page , Reading has not started yet ; and onunload The new page to be loaded has been read from the server , Called when the current page is about to be replaced .onunload You can't prevent the update and closing of the page . and onbeforeunload It can be done .
边栏推荐
- 【无标题】
- chromedriver对应版本下载
- Skip table: principle introduction, advantages and disadvantages of skiplist
- Analysis of the example of network subnet division in secondary vocational school
- Learn libcef together -- set cookies for your browser
- redis 无法远程连接问题。
- 今天很多 CTO 都是被干掉的,因为他没有成就业务
- Final review (Day6)
- 32GB Jetson Orin SOM 不能刷机问题排查
- College campus IP network broadcasting - manufacturer's design guide for college campus IP broadcasting scheme based on campus LAN
猜你喜欢
【一起上水硕系列】Day 7 内容+Day8
一起上水硕系列】Day 9
Export the altaro event log to a text file
【一起上水硕系列】Day 10
Gan network thought
[branch and cycle] | | super long detailed explanation + code analysis + a trick game
2022.DAY592
kubernetes资源对象介绍及常用命令(五)-(ConfigMap)
Personal outlook | looking forward to the future from Xiaobai's self analysis and future planning
Notepad++ wrap by specified character
随机推荐
ninja: build stopped: subcommand failed.
Progressive multi grasp detection using grasp path for rgbd images
2022.7.2day594
Today, many CTOs were killed because they didn't achieve business
Why should we rewrite hashcode when we rewrite the equals method?
Pessimistic lock and optimistic lock of multithreading
Altaro o365 total backup subscription plan
配置xml文件的dtd
Export the altaro event log to a text file
Obtenir et surveiller les journaux du serveur distant
2022.DAY592
中职网络子网划分例题解析
期末复习(DAY7)
Ensemble, série shuishu] jour 9
MySQL 5.7.32-winx64 installation tutorial (support installing multiple MySQL services on one host)
2022.6.30DAY591
[minesweeping of two-dimensional array application] | [simple version] [detailed steps + code]
获取并监控远程服务器日志
Go practice -- use redis in golang (redis and go redis / redis)
Mapbox tasting value cloud animation