我有打开窗口B的窗口A,打开窗口C的窗口.关闭窗口C时,我希望它刷新窗口B. [英] I have Window A that opens Window B that opens Window C. When Window C closes, I want it to refresh Window B.

查看:71
本文介绍了我有打开窗口B的窗口A,打开窗口C的窗口.关闭窗口C时,我希望它刷新窗口B.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有打开窗口B的窗口A,打开窗口C的窗口.关闭窗口C时,我希望它刷新窗口B.在窗口C中,我有以下内容:

I have Window A that opens Window B that opens Window C. When Window C closes, I want it to refresh Window B. In Window C I have this:

<body   onunload="opener.location.href = opener.location.href;">



这将刷新我的本地主机上的窗口B.如果我在开发Web服务器上使用相同的东西,那将不起作用.我收到权限被拒绝"错误.我猜想它不起作用,因为Window B和Window A和Window B在不同的域上.在我的本地主机上,所有窗口都是本地的.



This refreshes Window B on my localhost. If I use the same thing on our developement webserver, it doesn''t work. I get Permission Denied Error. I am guessing that it doesn''t work because Window B is on a different domain then Window A and Window B. On my localhost all of the windows were local. Is tehre a way to get this to work?

推荐答案

某些动作在跨域中被阻止了.解决此问题的一种方法是在您的B中编写一个函数,然后从C中调用它

certain actions are blocked in cross domain. One way to overcome this is to write a function in your B then call it from C

function reload()
{
  //force refresh  
}



然后调用该函数



Then call that function

<body   onunload="opener.reload();">


这篇关于我有打开窗口B的窗口A,打开窗口C的窗口.关闭窗口C时,我希望它刷新窗口B.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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