PDA

View Full Version : Reloading 'opener' window


bostjank
10-10-2002, 06:24 AM
Hi!

I'm using window.open... to load a page in seperate window. Is it possible to reload the page (or load a different page) in the windows that opened it (window.opener)?

Thanks,
Bostjan

glenngv
10-10-2002, 06:33 AM
why not just this?

window.open("url");
location.reload(); //to reload
//location.href="anotherpage"; //to go to another page


reload the current window after opening the child window.

bostjank
10-10-2002, 09:03 AM
The thing is that opener window must be reloaded from the window it opens - in that window is a form where user defines certain elements of the opener window.
I would like to use window.open function as i don't want the settings page to open in the same window.


Bostjan

glenngv
10-10-2002, 10:10 AM
that will open a new window then reloads the current window. but you can also do this if you want the opener window to be reloaded, say, on click of a button in the popup window:

in the popup:

<input type="button" value="Reload Parent" onclick="reloadParent()">

function reloadParent(){
parentWin = window.opener;
if (parentWin && !parentWin.closed){
parentWin.location.reload();
//other codes here
}
}