...

View Full Version : Window.opener question



Lazaroth
07-06-2002, 05:06 PM
Is it possible to use window.opener in frames...

////////////

main.htm ->

window.open('page.htm','page');

function al()
{
alert('hello');
}

////////////

page.htm ->

<frameset cols="40,*">
<frame src="left.htm">
<frame src="right.htm">
</frameset>

////////////

right.htm ->

window.opener.al(); //this doesn't work... it's there so you get the picture... :rolleyes:

////////////

I was thinking if something like window.opener.opener.al() possible could work... :confused:

redhead
07-06-2002, 05:12 PM
remember its window.open not window.opener...

window.open can be used in frames but im not sure if it can be accessed by the page in the frame

ACJavascript
07-06-2002, 06:27 PM
why don't you try somthing like this

window.opener.parent.left.location.href="bla.html"

i just used a location b/c i didn't know what your trying to do with the frame:D

Lazaroth
07-06-2002, 07:34 PM
By ACJavascript: just used a location b/c i didn't know what your trying to do with the frame

It's the function ai() in main.htm that I'm trying to reach from right.htm, (thought that was fairly obvious...)

I can't use just window.opener because the page is in a frame.
If it had been just one new window it would have worked as I wrote in my first message...

ACJavascript
07-06-2002, 07:54 PM
i don't think its possible to call a function in a different frame, or as window.opener. I could be wrong but i don't think so.

Spookster
07-06-2002, 09:59 PM
You can't use opener in right.htm because right.htm was not opened by main.html. Page.htm was the page opened by main.htm so......

how about

top.opener.al()

Lazaroth
07-07-2002, 05:27 PM
Hell, why didn't I think of that... top.opener.al()....

So obvious, thank you Spookster!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum