is there a possibility to open a new window with JavaScript and wait with jQuery until the new page has finished loading?
I tried the following, but it did not work:
var win = window.open(url,'',windowSpec);
$(win.window).load(
function () {
alert('Finished loading');
}
);
is there a possibility to open a new window with JavaScript and wait with jQuery until the new page has finished loading?
I tried the following, but it did not work:
var win = window.open(url,'',windowSpec);
$(win.window).load(
function () {
alert('Finished loading');
}
);
$(win.window).load
and for the finishing of the loading. But it does not work.
– Janus
Commented
Sep 20, 2012 at 12:12
Since the opened url is on the same server, it means that the two windows can municate.
Add on the page that opens in the window
$(window).load(function() {
var opener = window.opener || window.dialogArguments;
if (opener) {
opener.yourmethod();
}
});
and on the page that initiates the window.open
mand use
function yourmethod(){
alert('Finished loading');
}
Demo at http://jsfiddle/nmXdc/1
(the window that opens from the click is at http://jsfiddle/FPcMk/1/)