By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,253 Members | 1,680 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,253 IT Pros & Developers. It's quick & easy.

Timing problem between frames

P: n/a
Don
From within the "main" frame, using JS, I'm trying to copy a couple variables and arrays from the
"header" frame into the "main" frame. I've incorporated a couple "alert" statements to test the
resulting data, and find that sometimes it's good and sometimes it's "undefined". I'm thinking this
is a timing issue between the time the variables and arrays are resolved in the "header" frame, and
the time they are referenced in the "main" frame. There is no human intervention involved in either
frames, just the browsers load and execute times. How does one deal with this issue? Maybe, insert
a delay before the "main" frame is loaded or executed?

Thanks for any help.
Don

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Don" <no@adr.com> skrev i meddelandet
news:ap********************************@4ax.com...
From within the "main" frame, using JS, I'm trying to copy a couple variables and arrays from the "header" frame into the "main" frame. I've incorporated a couple "alert" statements to test the resulting data, and find that sometimes it's good and sometimes it's "undefined". I'm thinking this is a timing issue between the time the variables and arrays are resolved in the "header" frame, and the time they are referenced in the "main" frame. There is no human intervention involved in either frames, just the browsers load and execute times. How does one deal with this issue? Maybe, insert a delay before the "main" frame is loaded or executed?

Thanks for any help.
Don


You mean, the main frame attempts to access stuff in the header frame before
the header frame has finished loading?

When the header frame finishes loading, you could have it set a flag
variable in the main frame. When the flag is set, you know it should be OK
to access stuff in the header frame. (You'll also need to check so that you
don't attempt to set the flag before the main frame has finished loading).

--
Joakim Braun
Jul 23 '05 #2

P: n/a
Don
On Sun, 20 Feb 2005 10:37:00 +0100, "Joakim Braun" <jo**********@jfbraun.removethis.com> wrote:
"Don" <no@adr.com> skrev i meddelandet
news:ap********************************@4ax.com.. .
From within the "main" frame, using JS, I'm trying to copy a couple

variables and arrays from the
"header" frame into the "main" frame. I've incorporated a couple "alert"

statements to test the
resulting data, and find that sometimes it's good and sometimes it's

"undefined". I'm thinking this
is a timing issue between the time the variables and arrays are resolved

in the "header" frame, and
the time they are referenced in the "main" frame. There is no human

intervention involved in either
frames, just the browsers load and execute times. How does one deal with

this issue? Maybe, insert
a delay before the "main" frame is loaded or executed?

Thanks for any help.
Don


You mean, the main frame attempts to access stuff in the header frame before
the header frame has finished loading?

When the header frame finishes loading, you could have it set a flag
variable in the main frame. When the flag is set, you know it should be OK
to access stuff in the header frame. (You'll also need to check so that you
don't attempt to set the flag before the main frame has finished loading).

Hi Joakim,

Thanks for your response. I tried what you recommended, but when I test the flag I get an
"undefined" error msg if the header frame isn't loaded and startup code executed, which of course I
don't want displayed to the client. So, I was thinking of trying to setup another almost unvisible
(only 1 pixel, borderless) frame that will maintain the interlock variable. That, combined with a
preferred frame load order, as indicated in the <frameset>, might take care of the problem. That
should get me away from the "undefined" problem. I'll give that a try later today.

Thanks for your help.
Don

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.