admin管理员组文章数量:1024347
I want to
A) open a pop up window via javascript - easy enough
B) close this window via Javascript - easy enough
C) ensure that the window that spawned the popup in A is focused on again when close in B. Seem to remember can do this but can't remember how.
I want to
A) open a pop up window via javascript - easy enough
B) close this window via Javascript - easy enough
C) ensure that the window that spawned the popup in A is focused on again when close in B. Seem to remember can do this but can't remember how.
Share Improve this question edited Sep 1, 2010 at 12:31 Pranay Rana 177k37 gold badges243 silver badges266 bronze badges asked Sep 1, 2010 at 11:11 AJMAJM 32.6k50 gold badges161 silver badges248 bronze badges2 Answers
Reset to default 5script for closing child window and put focus back on parent window
window.opener.focus();
window.close();
Probably the user can close the popup in many ways as with a link, button or close button so a good way is to use the event onunload
so put this in the popup window
window.onunload = function(){
window.opener.focus();
}
I want to
A) open a pop up window via javascript - easy enough
B) close this window via Javascript - easy enough
C) ensure that the window that spawned the popup in A is focused on again when close in B. Seem to remember can do this but can't remember how.
I want to
A) open a pop up window via javascript - easy enough
B) close this window via Javascript - easy enough
C) ensure that the window that spawned the popup in A is focused on again when close in B. Seem to remember can do this but can't remember how.
Share Improve this question edited Sep 1, 2010 at 12:31 Pranay Rana 177k37 gold badges243 silver badges266 bronze badges asked Sep 1, 2010 at 11:11 AJMAJM 32.6k50 gold badges161 silver badges248 bronze badges2 Answers
Reset to default 5script for closing child window and put focus back on parent window
window.opener.focus();
window.close();
Probably the user can close the popup in many ways as with a link, button or close button so a good way is to use the event onunload
so put this in the popup window
window.onunload = function(){
window.opener.focus();
}
本文标签: Javascriptfocus on calling window after a closeStack Overflow
版权声明:本文标题:Javascript - focus on calling window after a close - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745591661a2157925.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论