当前位置:网站首页>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 .
边栏推荐
- Using the ethtool command by example
- Why is go language particularly popular in China
- Hotel public broadcasting background music - Design of hotel IP network broadcasting system based on Internet +
- Understand one-way hash function
- Method of finding prime number
- Talk about how to use p6spy for SQL monitoring
- Sophomore dilemma (resumption)
- Xaml gradient issue in uwp for some devices
- [trivia of two-dimensional array application] | [simple version] [detailed steps + code]
- 配置xml文件的dtd
猜你喜欢

期末复习(Day5)

Hotel public broadcasting background music - Design of hotel IP network broadcasting system based on Internet +

mapbox尝鲜值之云图动画

一起上水硕系列】Day 9

大二困局(复盘)
![[advanced pointer (2)] | [function pointer, function pointer array, callback function] key analysis + code explanation](/img/9b/a309607c037b0a18ff6b234a866f9f.jpg)
[advanced pointer (2)] | [function pointer, function pointer array, callback function] key analysis + code explanation

PHP笔记超详细!!!

Classification and discussion of plane grab detection methods based on learning

Pessimistic lock and optimistic lock of multithreading
![[branch and cycle] | | super long detailed explanation + code analysis + a trick game](/img/aa/543d4f0dcbcd664be963579af77ec9.jpg)
[branch and cycle] | | super long detailed explanation + code analysis + a trick game
随机推荐
Final review Day8
Sophomore dilemma (resumption)
[branch and cycle] | | super long detailed explanation + code analysis + a trick game
Qt读写Excel--QXlsx插入图表5
Niuke JS separator
@Autowired 导致空指针报错 解决方式
Together, Shangshui Shuo series] day 9
配置xml文件的dtd
[explain in depth the creation and destruction of function stack frames] | detailed analysis + graphic analysis
ansible防火墙firewalld设置
一起上水硕系列】Day 9
[untitled]
2022.7.2 simulation match
Pessimistic lock and optimistic lock of multithreading
Altaro virtual machine replication failed: "unsupported file type vmgs"
Map的扩容机制
Simpleitk learning notes
Azure file synchronization of altaro: the end of traditional file servers?
PHP笔记超详细!!!
Progressive multi grasp detection using grasp path for rgbd images