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
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
Share Improve this question edited Dec 9, 2010 at 11:20 munity wiki16 revs, 2 users 100%
Rajesh Rolen- DotNet Developer 3
- 1 This should work fine in Firefox (Maybe with the restriction that the parent URL still needs to be the same that opened the window, can't remember right now). Do you get any error messages in the error console? – Pekka Commented Jan 20, 2010 at 13:01
- no error .. and i have checked it with simple application.. but its not working – Dr. Rajesh Rolen Commented Jan 20, 2010 at 13:07
-
There's something you're not telling us. Please post a plete example.
window.opener.location.reload()
works in Firefox. Perhaps you're trying to go cross-domain, or you have JavaScript turned off, etc. – Jeremy Stein Commented Jan 20, 2010 at 18:18
2 Answers
Reset to default 2Check 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.