Each frame, redirecting
-
1. If I load a web page that contains frames then the OnDocumentComplete() is hit for each frame. How can I recognize that the page is completely loaded (no more frames missing)? 2. How to recognize that web page is redirecting?
Here is a way I was able to get it to work. The concept is that there is one hidden frame which counts the number of other frames which have finished loading. In the example, there are two frames showing and one too small to see. index.html: left.html and right.html: function notifyParent(){ parent.hide.watch++ } hide.html //child_frames is the number of frames you need to load child_frames=2 watch=0 function watchChild(){ if(watch == child_frames){ alert('all child frames are up') }else{ setTimeout("watchChild()",3000) } } As the frames come up, they add one to the "watch" variable in the "hidden" frame. Once the watch variable equals the child_frames variable, it is considered finished. You can replace the alert with whatever you need. I don't know if this would work with iframes, if you are using those instead. It may require tweaking. Hope this helps!