views:

37

answers:

2

how to access a parent window from child window after a child popup is opened? Thanks in advance

+3  A: 

window.opener

fantactuka
var popup = window.open("http://www.google.com"); popup.opener == window; //alerts true
Juan Mendes
`window.opener` a is a way to access to parent window from child. In this example you already have accesss point to the child - `popup` variable (no need to use `popup.opener`, just `popup`).
fantactuka
+3  A: 

http://www.javascriptkit.com/script/cut105.shtml

Fyi, there's generally no reason to do stuff like this for modern web devlopment. Popup is usually a bad word.