Suppose we open a popup through javascript when a link is clicked on parent window.
As everybody knows that parent window elements can be accessed from child window using the window.opener() function.
Is it possible to do exactly reverse ? Can parent window access the information about the child window ?
Suppose we open a popup through javascript when a link is clicked on parent window.
As everybody knows that parent window elements can be accessed from child window using the window.opener() function.
Is it possible to do exactly reverse ? Can parent window access the information about the child window ?
Share Improve this question asked Sep 19, 2013 at 9:11 Kshitij JainKshitij Jain 1,7935 gold badges20 silver badges30 bronze badges 2- Please check other similar questions on stackoverflow before asking... Solution has already been given 1000 times... – Yann39 Commented Sep 19, 2013 at 9:19
- There is no similar question on stackoverflow for this one. – Kshitij Jain Commented Sep 19, 2013 at 9:21
2 Answers
Reset to default 7You mean something like this:
a=window.open()
a.document.write("<div id='mydiv'>test</div>")
a.document.getElementById("mydiv")
When you open a window
through javascript's
window.open() function it returns you a reference
of the child window.
Using this reference you can access elements
of the child window, required it complies with Same origin policy security requirements.