I've tried contentDocument, contentWindow and everything

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Richard P

    I've tried contentDocument, contentWindow and everything

    I've feel that I have tried everything possible but I still cannot get
    my code to work in both netscape version 6 and IE.

    My Javascript is in XSL files but this should not matter.

    I am using the frameset below, the ids are different but the names are
    the same. The names are the same because I have a function to minimise
    and maximise a frame given its name and this uses getElementsByNa me.

    <frameset rows="50,50" id="fsMain">
    <frame id="frame1" name="frame"
    src="page.asp?x ml=frame1&amp;x sl=frame1"/>
    <frame id="frame2" name="frame"
    src="page.asp?x ml=frame2&amp;x sl=frame2"/>
    </frameset>

    In frame1 I have a function called 'testFrameGet'.

    'testFrameGet' calls function frameGot that exists in frame2.

    framegot displays an alert box.

    So far I have tried:

    //*************** ***
    // The following line works in IE but not in Netscape.
    // alert( parent.frames['frame2'].frameGot() );
    //*************** ***
    // this works in IE only.
    alert( top.frame2.fram eGot() );
    //*************** ***
    // this works in netscape and IE but only returns the window title,
    // I want to run a function.;
    //var objFrame = frameGet('frame 2');
    //if ( objFrame.conten tDocument )
    //{
    //var src_doc = objFrame.conten tDocument;
    //alert(src_doc.t itle);
    //}
    //else
    //{
    //alert('no content')
    //}
    //*************** ***
    //None of these work.
    //var objFrame = frameGet('frame 2');
    //objFrame.conten tDocument.docum ent.head.frameG ot() );
    //objFrame.conten tDocument.head. frameGot() );
    //objFrame.conten tDocument.frame Got() );
    //objFrame.conten tWindow.documen t.head.frameGot () );
    //objFrame.conten tWindow.head.fr ameGot() );
    //objFrame.conten tWindow.frameGo t() );
    //alert(doc.frame Got() );
    //alert( parent.window.f rames['frame2'].frameGot() );
    //alert( parent.frames['frame2'].window.frameGo t() );
    //alert( objFrame.frameG ot() );

    Any ideas?
  • Martin Honnen

    #2
    Re: I've tried contentDocument , contentWindow and everything



    Richard P wrote:[color=blue]
    > I've feel that I have tried everything possible but I still cannot get
    > my code to work in both netscape version 6 and IE.
    >
    > My Javascript is in XSL files but this should not matter.
    >
    > I am using the frameset below, the ids are different but the names are
    > the same. The names are the same because I have a function to minimise
    > and maximise a frame given its name and this uses getElementsByNa me.
    >
    > <frameset rows="50,50" id="fsMain">
    > <frame id="frame1" name="frame"
    > src="page.asp?x ml=frame1&amp;x sl=frame1"/>
    > <frame id="frame2" name="frame"
    > src="page.asp?x ml=frame2&amp;x sl=frame2"/>
    > </frameset>
    >[/color]

    I strongly suggest to use different names for different frames, then you
    can access
    parent.frames.f rameName
    to access a frame cross browser

    --

    Martin Honnen


    Comment

    Working...