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

Categories

0 votes
400 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 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...