Is there a way to open a new window with
var newWindow = window.open(...);
and then pass events from newWindow to its opening window?
I want to open a window in which some information is requested, after it is entered, close a new window and call the action in the original window.
Thanks.
edit: Thanks everyone. This is pretty much how I thought it worked, but I have to do something stupid. Here is some test code that I hit my head against the wall:
in parent.html
window.open("child.html"); $(window).bind("something", function(e) { console.log('something happened'); });
and in child.html
$("#somebutton").click(function() { $(window.opener).trigger("something"); window.close(); });
the child opens normally, I press the button, and the child closes, but "something" never happens in the parent !?
I would like it to be the other way around. Any way to do something like this work?
var child = window.open("child.html"); $(child).bind("something", function() { ... });
Thanks.
source share