How to determine if one frame has loaded from another?
Ted Bell
Ranch Hand
Joined: Jan 21, 2002
Posts: 52
posted
0
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
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
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:
inside NavBar:
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 ]
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: How to determine if one frame has loaded from another?