[Javascript] How to reference a frame object from within a frameset, using JavaScript, in IE?

Winnie T. Pooh mrpooh at hotmail.com
Thu Apr 26 02:25:37 CDT 2001


How to reference a frame object from within a frameset, using
JavaScript, in IE?

a user goes from a non-frameset page to a frameset page.  In that
frameset document, I want to use Javascript to determine what pages will
go in each frame (based on some variables I gather from the first page
using cookies).

This works fine in Netscape, but
I can't seem to be able to reference the frame object, in IE 5
(macintosh).
The names of my three frames are:
main_frame
exit_frame
nav_frame

My function includes the following code:

onLoad=
 window.top.main_frame.location="mainpage.html";
 window.top.exit.location="exit.html";
 window.top.photonav.location="nav.html";

The following attempts don't work either:
 parent.main_frame.location="mainpage.html"
 self.main_frame.location="mainpage.html"
 self.frames[0].location="mainpage.html"

Any clues as to how to do this?
It doesn't matter where I put my Javascript function.
IE gives me an error message  like: "self.frames[0] is not an
object...."
Perhaps I just can't access the frame objects from within the frameset
document itself, in IE.





More information about the Javascript mailing list