简体   繁体   中英

window.opener lost after redirect

The situation is as follows: I have a main window which opens a child window using window.open(). Then there are couple of forwards (it's Struts 1) because this is a multi-step wizard and the user can select multiple options in each step.

The problem is however that the window.opener is undefined in the last step of the wizard and I want to set a hidden filed in the parent page to some value(the page which actually created the window in which the wizard is happening). Window.opener is lost after going to the second step of the wizard.

Thanks for any suggestions.

If all you need is a specific value from the opener, get that on the first load of the window and store it in a hidden field - keep storing in hidden fields for all wizard steps and you will have the required value on the last wizard page.

Unfortunately, as the child window changes, you cannot retain information about the opener, as you discovered.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM