Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to determine if one frame has loaded from another?

 
Ted Bell
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic