How to refresh parent page using javascriptasp.net in mozilla firefox browser - Stack Overflow

The function window.opener.location.reload(); is working fine with IE but not refreshing parent page in

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 wiki
16 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
Add a ment  | 

2 Answers 2

Reset to default 2

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745108910a4611726.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信