on 05-29-2006 4:41 PM
Hi all,
I am opening a pop-up from my main page by window.open.
On the pop-up there is a YES button and a NO button.
When I click on YES button I want to replace the calling page at the background of the pop-up by a new page..i.e. I want to open a new page in the same browser instance as the calling page, and close the pop-up.
I tried doing window.open(new_page) at the YES button and then window.opener.close to close the calling page. But that obviously opens the new page in a new browser instance. I donot want that. I want to have the new page in the same browser instance as the parent page of the pop-up.Please help me. Thanks in advance.
Regards
Ananya
Try
var p_win = window.self;
p_win = p_win.opener;
p_win.location.href="new.htm";
window.close();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gladson,
Thanks a lot.It is working fine. But another issue is cropping up.
I am calling a server side event from the pop-up before closing it.Now,what is happening is,the pop-up is refreshing the background with the new page and closing itself without going to the server side event. How can I sort this out ? Please help.
Thanks®ards
Ananya
Is there any relation netween the page being loaded on the parent window and the server side event?
If No,
Replace the window.close command with ->
1. set a hidden form field with a flag
2. Submit the form using forms.submit
3. In On Input Porcessing of the Pop up, read the hidden field and if the flag is set, do your server side event.
4. Again in the layout, if this flag is set, call window.close
Then, call this script
var p_win = window.self;
p_win = p_win.opener;
p_win.location.href="new.htm";
window.close();
during the second round. That is, on clicking the Yes, submit the form and in the onInputProcessing, set a flag and on the layout, check the flag and then execute the above code.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.