PDA

View Full Version : how to refer to the original parent page


jasongr
11-23-2004, 06:39 AM
Hello

I have a regular html page called a.html
this page opens a modal dialog window called modal1.html
modal1.html contains a 'Next' button.
when the button is pressed the modal1.html is replaced with modal2.html

modal2.html contains another button.
when its button is pressed, the modal dialog window should close and the location of the original page a.html should change.
I am trying to do something like:

//window.parent.location.href = 'anotherPage.html';
window.opener.location.href = 'anotherPage.html';
window.close();

I cannot use window.opener in modal2.html because its opener is actually modal1.html.
In fact anotherPage.html is opened in a whole new browser page

How can I refer to a.html in this chain?

regards

MikeFoster
11-23-2004, 12:54 PM
Hmmm, this post looks very familiar.

hysterio
11-24-2004, 11:24 AM
if you have a modal dialog window, i guess you use window.showModalDialog. if so, try like this:

in your modal2.html you can do the following:

<input type="button" onclick="window.returnValue='new_url'; window.close();" value="blah blah">


in your original html you have something like this:

function blah_blah() {
var returnWaarde = window.showModalDialog(url, window, "dialogHeight: " + hoogte + "px; dialogWidth: " + breedte + "px; dialogTop: 0px; dialogLeft: 0px; edge: raised; center: no; help: no; resizable: no; status: no;");
self.location.href = returnWaarde;
}


hope this helps

jasongr
11-24-2004, 01:13 PM
yes
this is a smart solution
thanks, I will use it