Differences

This shows you the differences between two versions of the page.

framesinpopups [2009/01/18 12:49] (current)
admin created
Line 1: Line 1:
 +====== Accessing Frames in a Popup Window in JavaScript ======
 +For various reasons, it is hard to access a (frameset) frame in a popup window that you just opened. So what you want to do is store information in the popup window and let it perform whatever action needed itself:
 +
 +Parent window:
 +
 +<code javascript>
 +popup = window.open(url,name,options);
 +popup.parameters = ...
 +</code>
 +
 +Popup window:
 +
 +<code html>
 +<frameset onload="performAction(top.parameters)">
 +  <frame ...>
 +</frameset>
 +</code>
 +
 +If you actually need to access a frame, you should do it the same way. I.e. put the actual functionality in the frame window:
 +
 +<code html>
 +<body onload="performFrameAction(window.frameParameters)">
 +...
 +</body>
 +</code>
 
framesinpopups.txt · Last modified: 2009/01/18 12:49 by admin
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki