469,898 Members | 1,779 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,898 developers. It's quick & easy.

How to force a frame to load prior to others?

vk
I have a situation where I have 3 frames. The first frame is dynamic
and contains javascript variables for use throughout the frameset page
and the other frames.

Everything works fine...except that the first frame NEEDS to be loaded
first so that the other pages can access its variables. What happens
in IE is that the frames load up randomly (or so it seems). So
sometimes everything blows b/c the first frame did not load first and
all variables are undefined, etc.

So...essentially, what I'd like to know is...is there any way to force
a frame to load?...or perhaps some other trick, etc.

A few things I've tried...
....A timer loop after first frame to pause...did NOT work
....document.close() and document.open() after first frame...to clear
cache...did NOT work
....I put an alert() after the first frame, and that somehow forces
things to load in the correct order. But I cannot keep that alert
there.

Can anybody suggest anything...PLEASE...this is killing me...

Thx in advance...B.

Here is a snippet of code...

vOutput = '<frameset framespacing="0" border="0"
rows="0,80,98%,34,0" frameborder="0">\n';
document.writeln(vOutput);
vOutput = ' <frame marginheight="0" scrolling="no" noresize
marginwidth="0" name="variables" target="variables" src="' + vModId +
'/Variables.htm">\n';
document.writeln(vOutput);
//Need to pause here

vOutput = ' <frame marginheight="0" scrolling="no" noresize
marginwidth="0" name="header" target="main" src="header.htm">\n';
document.writeln(vOutput);
vOutput = ' <frame marginheight="0" scrolling="auto" noresize
marginwidth="0" name="main" target="main" src="main.htm">\n';
document.writeln(vOutput);
vOutput = ' <frame marginheight="0" scrolling="no" noresize
marginwidth="0" name="footer" target="main" src="footer.htm">\n';
document.writeln(vOutput);
vOutput = ' <frame marginheight="0" scrolling="no" noresize
marginwidth="0" name="ping" target="ping" src="../../Refresh.asp">\n';
document.writeln(vOutput);
vOutput = ' <noframes><body><p>This page uses frames, but your
browser doesn't support them.</p></body></noframes>\n';
document.writeln(vOutput);
vOutput = '</frameset>\n';
document.writeln(vOutput);
Jul 20 '05 #1
2 10445

"vk" <vk***@hotmail.com> schreef in bericht
news:e2*************************@posting.google.co m...
I have a situation where I have 3 frames. The first frame is dynamic
and contains javascript variables for use throughout the frameset page
and the other frames.

Everything works fine...except that the first frame NEEDS to be loaded
first so that the other pages can access its variables. What happens
in IE is that the frames load up randomly (or so it seems). So
sometimes everything blows b/c the first frame did not load first and
all variables are undefined, etc.

So...essentially, what I'd like to know is...is there any way to force
a frame to load?...or perhaps some other trick, etc.

A few things I've tried...
...A timer loop after first frame to pause...did NOT work
...document.close() and document.open() after first frame...to clear
cache...did NOT work
...I put an alert() after the first frame, and that somehow forces
things to load in the correct order. But I cannot keep that alert
there.

Can anybody suggest anything...PLEASE...this is killing me...

Thx in advance...B.

Here is a snippet of code...

Hi,

Why don't you load the other frames from variables.htm, like:

<body onload='fillFrames'>

and:

function fillFrames() {
parent.header.location="header.htm"
parent.main.location="main.htm"

etc..

Then, in the frameset, leave the src attr empty or about:blank

Fred
Jul 20 '05 #2
vk
"Fred Serry" <fr***************@planet.nl> wrote in message news:<bd************@ID-108377.news.dfncis.de>...
"vk" <vk***@hotmail.com> schreef in bericht
news:e2*************************@posting.google.co m...
I have a situation where I have 3 frames. The first frame is dynamic
and contains javascript variables for use throughout the frameset page
and the other frames.

Everything works fine...except that the first frame NEEDS to be loaded
first so that the other pages can access its variables. What happens
in IE is that the frames load up randomly (or so it seems). So
sometimes everything blows b/c the first frame did not load first and
all variables are undefined, etc.

So...essentially, what I'd like to know is...is there any way to force
a frame to load?...or perhaps some other trick, etc.

A few things I've tried...
...A timer loop after first frame to pause...did NOT work
...document.close() and document.open() after first frame...to clear
cache...did NOT work
...I put an alert() after the first frame, and that somehow forces
things to load in the correct order. But I cannot keep that alert
there.

Can anybody suggest anything...PLEASE...this is killing me...

Thx in advance...B.

Here is a snippet of code...

Hi,

Why don't you load the other frames from variables.htm, like:

<body onload='fillFrames'>

and:

function fillFrames() {
parent.header.location="header.htm"
parent.main.location="main.htm"

etc..

Then, in the frameset, leave the src attr empty or about:blank

Fred


Worked !!

Clever...never thought of that :(
It definately ensures the correct loading order.

Thx Fred...

Cheers...vk.
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Mike Preece | last post: by
5 posts views Thread by Tim Streater | last post: by
2 posts views Thread by Clay Harryman | last post: by
11 posts views Thread by opt_inf_env | last post: by
6 posts views Thread by pierre.bru | last post: by
2 posts views Thread by Yogi_Bear_79 | last post: by
16 posts views Thread by janders | last post: by
42 posts views Thread by smerf | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.