Reputation: 1793
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 ?
Upvotes: 5
Views: 27867
Reputation: 5563
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.
Upvotes: 6
Reputation: 891
You mean something like this:
a=window.open()
a.document.write("<div id='mydiv'>test</div>")
a.document.getElementById("mydiv")
Upvotes: 7