473,390 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,390 software developers and data experts.

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 10691

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mike Preece | last post by:
Hi I have to apologise for this in advance.. Sorry I know this is the wrong group to ask but this question I don't know where I should be asking it. What can I send from the server to a...
5
by: Tim Streater | last post by:
I have this arrangement of frames: <html><head><script type="text/javascript"></script></head> <frameset rows="100,*"> <frameset cols="135,*,165"> <frame name="logo" src="some.html"...
2
by: Clay Harryman | last post by:
I've found a script that will force-load index.html. It is below: (thanks to the authors!) <!-- Hide script from old browsers // This script copyright 1997, Tom Negrino and Dori Smith. // This...
11
by: opt_inf_env | last post by:
Hello everybody, I have created a page consisting of two frames. The second frame is made to display "external" sites (i.e. written not by me, for example www.google.com). But I found that some...
6
by: pierre.bru | last post by:
hi, I encounter troubles with frames :( witht he folowing script in the _top page function walk(_frames) { for(var i=0; i<_frames.length; i++) { var frame = _frames; alert(frame.name);
3
by: qwerty | last post by:
Im new to ASP.Net. My workmate has some experience with it. He claimed that in ASP.Net working with frames is much simpler than it was ASP. I asked explanation but he couldn't give me such. (a...
2
by: Yogi_Bear_79 | last post by:
I have a script that parses window.location.hash to figure out which xml file to load. The xml files populate a page on a framed site. The code works correctly to a point. If I have a seperate...
16
by: janders | last post by:
Hey all, I've got a document that I want to ensure always get loaded into the top level document and not into a frame or iframe. I've got it figured out how to detect if the document is loaded...
42
by: smerf | last post by:
Using javascript, is there a way to trap an external page inside a frame? I've seen scripts to break out of frames, but nothing to keep a page trapped in a frame.
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.