Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
471 views
in Technique[技术] by (71.8m points)

javascript - Permission denied to access property in IFRAME

I have a link in my jsp page .

the link looks like this

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

the javascript code

    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;
      }
    }

When the user clinks on this clinks everything works fine. Now recently I put this code inside a Iframe and then nothing happens. I checked with firebug and got this error :

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

What can be the problem?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It's possibly the same origin policy kicking in. Is everything served from the same host/port?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...