在浏览器上关闭 [英] On browser close

查看:94
本文介绍了在浏览器上关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
当我关闭子窗口浏览器时,我想刷新我的父页面.子窗口和父窗口都使用母版页.但是在哪里可以使用javascript处理OnUnload方法来刷新父页面.我在主体标签中使用了以下代码

onunload ="window.opener.location.reload(false)"

它工作正常.但是在执行其他表单时遇到问题,因为这些表单也会使用母版页.因此,我想在我的特定子窗体中使用此onunload.如何处理.请建议或发送代码

感谢

Hi every one,
I want to refresh my parent page when i close child window browser. both child and parent window uses master page. But where to handle OnUnload method using javascript for refreshing the parent page. i used the below code in master body tag

onunload="window.opener.location.reload(false)"

it is working fine. but getting problem while executing other forms as these forms also use the master page. So i want to use this onunload in my specific child form. How can this be handled. Plz suggest or send the code

thanks

推荐答案

在子窗口上使用以下代码

on child window use the following code

window.close();<br />
if (window.opener && !window.opener.closed)<br />
{<br />
   window.opener.location.reload();<br />
}



问候
koolprasad2003:)



regards
koolprasad2003 :)


这篇关于在浏览器上关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆