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:
- You can access
Window#document
of another window only if it is of the same origin (same host, port and protocol). - 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
精彩评论