In JavaScript, what are window.opener, window.parent, and window.top, and when can I use them?
In JavaScript, what are window.opener , window.parent , and window.top , and when can
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
window.openerrefers to the window that calledwindow.open( ... )to open the window from which it’s calledwindow.parentrefers to the parent of a window in a<frame>or<iframe>window.toprefers to the top-most window from a window nested in one or more layers of<iframe>sub-windowsThose will be
null(or maybeundefined) when they’re not relevant to the referring window’s situation. (“Referring window” means the window in whose context the JavaScript code is run.)