How can i see if the frame is loaded???

Hi,

How can i see if the frame is loaded or is loading???

I have two frames, in both of the frames i have javascript but the problem is that if the first frame is loaded but the second is loading that the first frame call to the second frame and there is a error becouse the second frame isn't yet loaded. How can a check if the second frame is loaded?

Alex Elderson

Comments

  • one way to overcome this problem is a theory called DanTags, place a tag, or in otherwords a variable, in the first frame. now concerning the function in the first that calls something in the second frame, don't let that happen unless tag = *a certain value* which is set by the onLoad of the second frame.

    example

    FRAME1----------------------------

    var tag //notice that the tag is outside of the function
    function openFunctionInFrame2() {
    if(tag!=1){
    setTimeOut("openFunctionInFrame2()", 250)
    //above line re-tests the value of tag in a quarter of a second
    } else {
    parents.frames[1].functionName()
    }
    }


    FRAME2----------------------------

    *


    function functionName(){
    alert("do you understand where i am coming from?");
    }




    this is just a quick jot out of my head, make sure you check all the syuntax, this will give you the basic idead
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion