Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: Re: Flash2: forcing a loading order with onLoad="changeWindowContents('new.html')"
From: Jason Nugent
Date: Sun, 24 May 1998 20:57:37 +0100


Hey andrew, you might want to try using -

window.body.location.href

where body is the name of your frame. Later versions of JavaScript can
reference frames in framesets without it, but you might have problems
leaving it off in older browsers. Give that a try and let me know what
happens.

Also, if that fails to work, you might want to try using the
frames array in JavaScript. All frames are stored in an array, which can
be referenced like this

window.frames[0].location.href

which will reference the first frame (arrays count from zero) in
a frameset, while

window.frames[1].location.href will reference the second one. I'm
not sure if body is the first, second, or third frame in your document,
soyou might have to experiment.

Good luck, and I hope this helps.

Jason


On Sun, 24 May 1998, Andrew Ayres wrote:

> Hi,
>
> My thanks to Jason, and John, for their help - it is very much appreicated.
> I've tried your Javascript, and it works for IE4 and Communicator. With
> Netscape 2.02 and 3, however, I get a Javascript error, "body is not defined"
> ("body" being the name of my right frame). Is this because the Javascript
> is of
> a later version? Is there any way to create a solution that works for Netscape
> 2.02+ and IE3.02+ ?
>
> cheers, Andrew
>
> The Javascript I used:
>
> <SCRIPT language="JavaScript"><!--
>
> function changeWindowContents(newURL){
>
> body.location.href = newURL;
>
> }
>
> // -->
> </SCRIPT>
>
> </HEAD>
> <FRAMESET BORDER=0 FRAMESPACING=0 FRAMEBORDER="no" BORDER="0" COLS="137,*"
> onLoad="changeWindowContents('final-right.html')">
> <FRAME NAME="left" SRC="left.html" SCROLLING="no" MARGINWIDTH="2"
> MARGINHEIGHT="2" FRAMEBORDER="no" BORDER="0" NORESIZE>
> <FRAME NAME="body" SRC="dummy-right.html" SCROLLING="auto" MARGINWIDTH="2"
> MARGINHEIGHT="2">
> </FRAMESET>
>
> <BODY>
>
> nb: I put the function definition inside the HEAD. when I put the function
> definition inside the frameset I get, "changeWindowContents is not defined"
>
> Jason wrote:
> <SCRIPT language="JavaScript"><!--
> function changeWindowContents(newURL){
> rightFrame.location.href = newURL;
> }
>
> // -->
> </SCRIPT>
> place this inside the <FRAMESET> tag of your main frameset.
> rightFrame is the name of the frame that you want to change the location of.
> <FRAMESET other_stuff_goes_here onLoad="changeWindowContents('new.html')">
> note that you don't need parent.rightFrame.location.href, instead
> just rightFrame.location.href, since the function is located in the top
> level frameset document. Your frameset will load, with its initial
> document, and then the new one will load based on the function above
> which gets called when the frameset is loaded. new.html is the name of
> the file you want to load in the frame.
> Hope that helps,
> Jason
>
> > At 03:58 PM 5/22/98 -0400, John wrote:
> > >For Flash 2 JavaScript must be enabled:
> > >Load a blank or Static logo in the right frame.
> > >Replace the contents of the right frame with the Spaghetti using onLoad
> > >in frameset. onLoad in the frameset will not execute until all the
> > >frames are loaded. In your case the left and right(a temporary blank or
> > >Logo page).
> > >John Croteau <croteauaterols [dot] com (mailto:croteauaterols [dot] com)>croteauaterols [dot] com (mailto:croteauaterols [dot] com)
>
>
>
> ------------------------------------------------------------------------
> To UNSUBSCRIBE send: unsubscribe flasher in the body of an
> email to list-manageratshocker [dot] com. Problems to: owneratshocker [dot] com
> N.B. Email address must be the same as the one you used to subscribe.
> For info on digest mode send: info flasher to list-manageratshocker [dot] com
>

---------------------
Jason Nugent, BSc(Hons)
ap958atchebucto [dot] ns [dot] ca "Beneath this canvas monochrome
Certified Webmaster Wrapped in the shroud of this grey home
I'll paint a picture all my own
I'll paint a picture"
Live to ride,
Ride to Live. -Anacrusis

********************************************************************
The Best Place for Sport on the net! - Sportscience www.sportsci.org
********************************************************************


------------------------------------------------------------------------
To UNSUBSCRIBE send: unsubscribe flasher in the body of an
email to list-manageratshocker [dot] com. Problems to: owneratshocker [dot] com
N.B. Email address must be the same as the one you used to subscribe.
For info on digest mode send: info flasher to list-manageratshocker [dot] com


Replies
  Re: Flash2: forcing a loading order with, Andrew Ayres

Replies
  Flash2: forcing a loading order with onL, Andrew Ayres

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]