简体   繁体   中英

How to refresh parent page using javascript / asp.net in mozilla firefox browser

The function window.opener.location.reload(); is working fine with IE but not refreshing parent page in mozilla firefox browser. please tell me how to refresh parent page in cross browser/browser independent.

i have got this function:

Shared Sub CloseMyWindow()
Dim tmpStr As String = ""
tmpStr += "window.open('','_parent','');window.close();"
tmpStr += "window.opener.location.reload();"  

HttpContext.Current.Response.Write("<script language='javascript'>" + tmpStr + "</script>")
HttpContext.Current.Response.End()
End Sub

Thanks

Check out this tutorial and maybe try an alternative ways to refresh the page (just to be sure ;)) like

window.opener.location.href = window.opener.location.href

as the reload way seems not to work in Firefox (actually the opener property should)

Try to install Firebug or some other diagnostic tool to see whether the opener property is not null and better understand the problem. Firebug is awesome anyway :)

You can use

window.location.reload(true)

by passing through the true you will avoid the problem of the popup firefox and most browsers display. This does have an affect though by reloading all images, css and js from the server and not from cache.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM