How to determine if one frame has loaded from another?
Joined: Jan 21, 2002
Hi all, I want to be able to call a function on frame A from frame B, but how can I be sure that frame A is loaded? I get an error if the frame being called is not done loading and am not sure how to check for this condition (or handle the error so the user does not see it. Thanks Art
Joined: Nov 22, 2008
It may not be the slickest solution in the world, but you can set a boolean in the frameset page to false. Then in the frame that you are waiting on to load, set the boolean to true from inside the onLoad event. Then just have your other page check the value of the boolean at intervals and run your function when ever it is loaded. For example, let's say you have a function in Content that can't run until NavBar is loaded. Inside the main.htm:
finally, inside Content:
That will cause content to recheck NavBar's status every half second until it is loaded. Hope that helps. I had to put my "onLoad" event in quotes because UBB didn't like it without. Obviously you will have to remove the quotes to make it work. [ February 07, 2002: Message edited by: Bodie Minster ]