reference to popup from popup 
Author Message
 reference to popup from popup

Hi all,
I thought I was quite good at Javascript until I had this problem ealear
this day.
It's complicated, I'll try to be as clear as possible.
There's a html-page (no frames) with a link. That link creates a
popup-window. That popup-window is actually a frameset with 2 frames(top &
bottom). In the bottomframe there is (again) a link. That link creates a
second popup-window (no frames), with a link in it.
And now it comes: I want to click on that link, and to load a frameset
(bottom a top)in the very first window (remember that there was no frameset
in it) and I want to change the bottom frame of that frameset.
I know it has to do with this and opener and locations, but I can't figure
out the exact syntax.

Can somebody help me?

address)

Thanks, kind regards,

Jo Lambrichts



Sat, 10 Jul 2004 04:07:31 GMT  
 reference to popup from popup

Quote:
>a html-page (no frames) with a link.
> That link creates a popup-window.

<!-- code on Main Page -->
<span style="cursor:hand"
 onclick="window.open('popup1.htm')">
CLICK FOR POPUP 1
</span>

Quote:
>That popup-window is a frameset with 2 frame(top&bottom)

<!-- code in popup1.htm -->
<frameset name="frameset1" ROWS="50%, *">
<frame name="top1"></frame>
<frame name="bottom1" src="bottomFrame.htm"></frame>
</frameset>

Quote:
> In the bottomframe there is (again) a link.

<!-- code in bottomFrame.htm -->
<span style="cursor:hand"
    onclick="window.open('popup2.htm')">
CLICK FOR POPUP 2
</span>

Quote:
> That link creates a
>second popup-window (no frames), with a link in it.
>And now it comes: I want to click on that link, and to
>load a frameset
>(bottom a top)in the very first window (remember that

there was no frameset
Quote:
>in it) and I want to change the bottom frame of that

frameset.

<!-- code in popup2.htm -->

<script>
function reloadGrandParent()
{
  var grandParent = window.opener.top.opener;

/* load the frameset in grandParent*/
var str =
       "<FRAMESET NAME='frameset2' ROWS='50%, *'>";
  str += "<FRAME name='top2'></FRAME>";
  str += "<FRAME name='bottom2'></FRAME>";
str += "</FRAMESET>";
  grandParent.document.write(str);

/* make your changes to the bottom frame */
grandParent.frames.bottom2.document.write("IT WORKED");

Quote:
}

</script>

<span style="cursor:hand"
    onclick="reloadGrandParent();">
Reload GrandParent Window
</span>



Sat, 10 Jul 2004 15:16:53 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. popup from a popup

2. reference diff window from modal popup

3. referencing popup window

4. popup window

5. popup object

6. Stop browser's popup menu

7. VBScript and DHTML Popup

8. Popup menus - responding to events

9. Popup-window (vbs / wsh)

10. Closing a popup created with window.createPopup()

11. popup object not displayed in IE5 with VBScript

12. reloading IFRAME from popup

 

 
Powered by phpBB® Forum Software