dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: frames - how to open 2 htms by clicking one link

  1. #1
    Join Date
    Oct 2003
    Location
    Ireland
    Posts
    41

    Red face frames - how to open 2 htms by clicking one link

    okay, similar to already asked question.

    I use a javascript to open 2 htm is a frameset by clicking one link

    <script><!--
    function charger1(mainframe,leftdown){
    parent.mainframe.location=mainframe;
    parent.left.location=left;

    }
    //--></script>

    mainframe=a
    left=navigation link =b
    leftdown=c
    leftup=d
    _______
    | | |
    |b|a | now i load with a link in b a new frameset into b
    | | |

    _______
    |c| |
    |-|a |
    |d| |

    If i now klick on a link in c, with the above script, it won't open, bringing error "parent.mainframe is null or not an object"
    don't really know what that means but guess it can't find mainframe as only looking in child frame?

    how can i load a link from c into d (child frame) and a (parent frame). Can the above script be modified or do i need a new one and if yes, which one?

    oh in the body, the scripts is called with:

    <A HREF="javascript:charger1('test.htm','test2.htm');">link </a>

  2. #2
    Join Date
    Jun 2005
    Location
    Denmark
    Posts
    135
    parent.parent.mainframe.location

    parent. refers to the direct parent of the document.
    but mainframe is a direct child of the "grandparent" or "the parent of the parent"
    which must be refered to as parent.parent.

    or

    top.mainframe.location

    mainframe is a direct child of the top document.

  3. #3
    Join Date
    Oct 2003
    Location
    Ireland
    Posts
    41

    Talking ownderfull

    Oh wonderfull it works as it should, thanks a lot

    mfg

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles