The proper way to handle popup closing

偶尔善良 提交于 2019-12-04 09:58:44

You might want to look into the unload event, take a look at Javascript: Popups

edit: as you've said you cannot edit anything inside the popup, there really aren't any options left. I believe your current setInterval code does the job just fine. You should ask yourself if realtime detection of the popup closing is absolutely critical. That 500 milliseconds timer certainly won't strain hardly any resources or bring someones computer to its knees.

I have used jQuery Dialog and it has a close event

http://jqueryui.com/demos/dialog/.

Am not sure if I understand your question right,why do you want to use the timer ?

Use window.opener in the pop-up window. i.e. something like:

onunload = opener.alert('popup closed');

or

onunload = opener.nameOfAFunction();
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!