Verifying page load

They have: 99 posts

Joined: May 1999

This is an ongoing prob for me. I have work arounds that work, but are annoying.

Is there an accurate way to verify if each frame on a page has finished loading.

I wish to have a script in one frame refer to a value in another frame. If the document in the frame the script is refering to is not loaded or not finished loading...boom!!...lovely script errors!!

Is there a property I can refer to on the window level to verify that all scripts are loaded???

The top.document is a frames doc...any way to have a form in the frames doc that I can access...dont think I can do that with a frames doc, but thought I'd ask.

As always, any help is appreciated.

Tazman

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi taz,

Did you try sending vars with the onLoad command?

then in your form submissions
if (loadVar)

Vinny

They have: 99 posts

Joined: May 1999

The problem I have encountered with that method is the same as the original problem.

Each frame loads at its own pace, to send the data from one frame to the other, you must first know that the destination frame is loaded.

This is mostly a problem at initial load time of the site. The frames load up and then need to address each other. Sometimes one frame loads before the other, sometimes it does not.

Is there a way to track the status of the frame loads by somehow getting a form to sit in the parent frames document??

Is there a property of the top.document that can determine the status of the frames load??

Tazman

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi taz,

Somewhere in the back of my tiny mind, I recall mention of a solution on one of the other boards. Unfortunately, it isn't coming to the forefront -- which is why I suggested the above workaround. If I ever run across it again, I'll let you know.

Vinny

Where the world once stood
the blades of grass cut me still

They have: 231 posts

Joined: Feb 2000

What I would do is create a variable within each frame named 'isLoaded' and use the onLoad event handler to set this to true. From the calling frame I would create a function that loops until the target frame has loaded.

function setFrameValue() {
   if (!FRAMENAME.isLoaded) {
      window.setTimeout("setFrameValue()",50);
      }
   else {
      // do your stuff...
      }
   }
'

:: Lloyd Hassell :: http://www14.brinkster.com/lloydh ::

They have: 99 posts

Joined: May 1999

Thanks Lloyd!

I think I will give that a shot. I'll see if this avoids the object not defined or object has no properties issues I have run into.

Thanks all for the assist.

Tazman

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.