aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes How to determine if one frame has loaded from another? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to determine if one frame has loaded from another?" Watch "How to determine if one frame has loaded from another?" New topic
Author

How to determine if one frame has loaded from another?

Ted Bell
Ranch Hand

Joined: Jan 21, 2002
Posts: 52
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
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://aspose.com/file-tools
 
subject: How to determine if one frame has loaded from another?