2012-09-17 129 views
0

我有一个简单的网页,分为三个iframe A,B,C。来自iframe的HTML刷新页面

iframe B执行Ajax请求,它应该刷新页面以重定向到我的登录页面。 显然,登录页面仅在iframe B内发生。有一种方法可以完全重定向页面?

回答

1

不会简单检查top.location的工作吗?

<script type="text/javascript"> 
    <!-- 
     if (top.location!= self.location) { 
      top.location = self.location.href 
     } 
    //--> 
</script> 
+0

您的解决方案非常好。但是,如果我有这样的配置:顶部 CeccoCQ

+0

你可以把你的代码放在http://jsfiddle.net/ –

0

这应该有效。

<script> 
    Window.top.location = 'new url'; 
</script>