maintain opener property after refresh/reload of popup

B

Bruce

I have an application where a main window opens a popup window. Within
the popup, I want to be able to post a form back to the popup all the
while maintaining the opener property.

Of course, once the popup window re-loads itself by posting a form to
itself, all Javascript state information is lost and so opener is
undefined.

Is there any way I can communicate with the original opener of a popup
window once the popup window has been reloaded?

Since opener is an object, it's not like I can simply include opener
in the posted form.

Is there some way I can use the window name of the opener to
communicate with the opener once the popup is refreshed?

I realize I could probably get around this with some clever usage of
Ajax so that the popup window content is refreshed without actually
reloading the page but I'm hoping there is some simpler trick I've
overlooked.
 
J

Joost Diepenmaat

Bruce said:
Of course, once the popup window re-loads itself by posting a form to
itself, all Javascript state information is lost and so opener is
undefined.

Are you sure about that?
 
B

Bruce

Are you sure about that?

Well, I create a popup, use opener.someFuncName() to run code in the
parent window. That works fine. If I allow the popup to post back to
itself and then try opener.someFuncName(), opener has no properties.

Should I be able to post a form from a popup back to the popup and
still maintain the opener property?
 
B

Bruce

Are you sure about that?

Seems it was something else. When I reduced my code down to the
simplest test, it works. It seems opener does survive a POST
operation. I was passing the name of the main function to be called by
the popup to the popup when the window was created and I failed to
include that function name in the POSTed form. It was the function
name that was not being preserved, not the opener property.

Problem solved.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top