Using jQuery, how can you trigger an event from a child window, in the parent window?
Basically I want to call a function in the parent window. I thought I could hook an event handler 开发者_如何学编程to a function I want to run in the parent... any thoughts how to do this?
From child window, use
parent.MyFunction()
window.opener.parent.function() does the trick, but in my case I needed to keep a copy of window because the context changed when I used setTimeout.
var _window = window;
setTimeout( function(){
//location.reload(true);
_window.opener.invite_child_response();
_window.close();
},5000);
精彩评论