开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜