拒绝访问IFRAME中的属性

Permission denied to access property in IFRAME

本文关键字:属性 IFRAME 拒绝访问      更新时间:2023-09-26

我的jsp页面中有一个链接。

链接是这样的

<a href="javascript:doSomething('abc.ff' , 'abc.ff?m=1')">

javascript代码

    function doSomething(url, url_progress){
    parent.win1.location.href = url;    
    /* Wait until something surely has started! */
    window.setTimeout("this.startFinally()", 1000); 
    this.startFinally = function (){
    location.href = url_progress;
      }
    }

当用户点击这个链接时,一切正常。现在,最近我把这段代码放入一个Iframe,然后什么也没发生。我检查了firebug,得到了这个错误:

   Permission denied to access property 'win1'
   [Break On This Error] parent.win1.location.href = url; 

有什么问题吗?

可能是同源策略起作用了。所有服务都来自同一个主机/端口吗?