Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > ref from one frame to another w/in frameset

Reply
Thread Tools

ref from one frame to another w/in frameset

 
 
Frances Del Rio
Guest
Posts: n/a
 
      07-06-2004
sorry, but need to post entire frameset here to ask my question:

<frameset rows="79,344,107">
<frame name="header" src="header.html">
<frame name="player" src="mediaselect.html">

<frameset cols="353,*">
<frame name="left" src="left.html">
<frame name="right" src="right.html">
</frameset>
</frameset>

I need to ref. from within right.html to mediaselect.html... (i.e.,
from frame name "right" to frame name "player"..) I need to say if
such-and-such a url is loaded into frame named "player" then do
such-and-such... I tried:

-- parent.frames.player.location // and
-- parent.parent.frames.player.location

I haven't done JS w/frames in a while, so I forget exactly how you ref.
to another frame in frameset when you're dealing in nested framesets..
thank you...

Frances Del Rio

 
Reply With Quote
 
 
 
 
kaeli
Guest
Posts: n/a
 
      07-07-2004
In article <>, enlightened
us with...
> sorry, but need to post entire frameset here to ask my question:
>
> <frameset rows="79,344,107">
> <frame name="header" src="header.html">
> <frame name="player" src="mediaselect.html">
>
> <frameset cols="353,*">
> <frame name="left" src="left.html">
> <frame name="right" src="right.html">
> </frameset>
> </frameset>
>
> I need to ref. from within right.html to mediaselect.html...


If you don't need to worry about being in someone else's frameset, you
can use

top.frames['player'].location.href;

to get the string representation of the URL. [1]
Otherwise, I *think* you can use

self.parent.parent.frames['player'].location.href;

but I haven't played with nested framesets in a long time.

I believe that if the frame has loaded content outside your domain, this
will fail as a security violation.

[1] IIRC, using just window.location returns a Location object, not a
string.

--
--
~kaeli~
Hey, if you got it flaunt it! If you don't stare at someone
who does. Just don't lick the TV screen, it leaves streaks.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

 
Reply With Quote
 
 
 
 
Frances Del Rio
Guest
Posts: n/a
 
      07-07-2004
just wanted to say (sorry, posted this last night, was tired) that I
get errors that say "parent.frames.player.location" or whatever I try
is "not an object.." thank you.. Frances



Frances Del Rio <> wrote in message news:<>...
> sorry, but need to post entire frameset here to ask my question:
>
> <frameset rows="79,344,107">
> <frame name="header" src="header.html">
> <frame name="player" src="mediaselect.html">
>
> <frameset cols="353,*">
> <frame name="left" src="left.html">
> <frame name="right" src="right.html">
> </frameset>
> </frameset>
>
> I need to ref. from within right.html to mediaselect.html... (i.e.,
> from frame name "right" to frame name "player"..) I need to say if
> such-and-such a url is loaded into frame named "player" then do
> such-and-such... I tried:
>
> -- parent.frames.player.location // and
> -- parent.parent.frames.player.location
>
> I haven't done JS w/frames in a while, so I forget exactly how you ref.
> to another frame in frameset when you're dealing in nested framesets..
> thank you...
>
> Frances Del Rio

 
Reply With Quote
 
Frances Del Rio
Guest
Posts: n/a
 
      07-07-2004

thank you..

now it's saying that this stmt is missing a ")" ....
if (self.parent.parent.frames['player'].location.href; == 'wmp.html') {

if I do
if (document.all) {
it's fine, but if I do above stmt it says I'm missing a ")"... ?????

also, what's the difference betw.
if (whatever.location == 'page.html') // and
if (whatever.location.href == 'page.html')

thank you.. Frances


kaeli wrote:

> In article <>, enlightened
> us with...
>
>>sorry, but need to post entire frameset here to ask my question:
>>
>><frameset rows="79,344,107">
>> <frame name="header" src="header.html">
>> <frame name="player" src="mediaselect.html">
>>
>> <frameset cols="353,*">
>> <frame name="left" src="left.html">
>> <frame name="right" src="right.html">
>> </frameset>
>></frameset>
>>
>>I need to ref. from within right.html to mediaselect.html...

>
>
> If you don't need to worry about being in someone else's frameset, you
> can use
>
> top.frames['player'].location.href;
>
> to get the string representation of the URL. [1]
> Otherwise, I *think* you can use
>
> self.parent.parent.frames['player'].location.href;
>
> but I haven't played with nested framesets in a long time.
>
> I believe that if the frame has loaded content outside your domain, this
> will fail as a security violation.
>
> [1] IIRC, using just window.location returns a Location object, not a
> string.
>


 
Reply With Quote
 
kaeli
Guest
Posts: n/a
 
      07-07-2004
In article <>, enlightened
us with...
>
> thank you..
>
> now it's saying that this stmt is missing a ")" ....



> if (self.parent.parent.frames['player'].location.href;


Um, get the semi colon out of there if it's part of an if statement.


if (self.parent.parent.frames['player'].location.href == 'wmp.html') {

--
--
~kaeli~
The man who fell into an upholstery machine is fully
recovered.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
passing ref to ptr again as ref to ptr.... osama178@gmail.com C++ 22 04-30-2008 10:42 AM
passing ref to ptr again as ref to ptr.... osama178@gmail.com C++ 6 04-29-2008 08:09 AM
passing ref to ptr again as ref to ptr.... osama178@gmail.com C++ 0 04-24-2008 08:23 PM
Changing src of a frame of a frameset within another frameset? Julius Mong Javascript 1 05-10-2004 07:35 PM
How do you make sure a frameset is loaded? I'm trying to open a frameset in a new window which shows a specific html page in a specific frame ck388 Javascript 1 09-24-2003 08:32 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57