开发者

why "$(opener.document).ready()" is not working?

I tried something like, below in popup-window, but开发者_高级运维 not working...

any correction at line 3, please suggest.

function closePopup() {
    window.opener.history.go(0);
    $(opener.document).ready(function(){
        window.opener.some_function(some_variable);
        self.close();
    });
}


Two things:

  1. You can access Window#document of another window only if it is of the same origin (same host, port and protocol).
  2. Even if the above case is satisfied, the document object isn't constructed immediately after you navigate to a page. history.go() is not a synchronous operation.

Have you tried Window#load event instead?


Check out this option: http://plugins.jquery.com/project/popupready

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜