problem loading another frame

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wmbrae
    New Member
    • Apr 2008
    • 3

    problem loading another frame

    i'm a total newbie, been at this for 3 days.

    The sample below works. It consists of 4 separate htm files.

    Lauch 01.htm creates 2 frames _L, _R and _R has a link which when pressed will load 03.htm into _L and 03.htm will load 04.htm into _R.

    When all files are in the same directory it works
    When 03.htm is stored in a sub-directory (called sub) below the other files, the load

    parent._R.locat ion.href = "04.htm"

    doesn't work.
    In 02.htm I specify (note in href= the addition of sub\

    <a href="sub\03.ht m" target="_L">loa d 03.htm into _L</a>

    and when you click on the link load 03.htm into _L it loads 03.htm just fine but the script in the header doen't work.
    Can anyone help?
    Thanks.


    <! 00.htm

    [HTML]<HTML>
    <HEAD><TITLE>&n bsp</TITLE></HEAD>
    <BODY> Opening screen _L </BODY>
    </HTML>
    [/HTML]
    <! 01.htm

    [HTML]<HTML>
    <FRAMESET COLS="82%,*">
    <FRAME NAME="_L" SRC="00.htm">
    <FRAME NAME="_R" SRC="02.htm">
    </FRAMESET>
    </HTML>
    [/HTML]
    <! 02.htm

    [HTML]<HTML>
    <HEAD><TITLE>02 </TITLE></HEAD>
    <BODY>

    <a href="03.htm" target="_L">loa d 03.htm into _L</a>

    </BODY>
    </HTML>
    [/HTML]

    <! 03.htm

    [HTML]<HTML>
    <HEAD><TITLE>te st</TITLE><SCRIPT>

    parent._R.locat ion.href = "04.htm";

    </SCRIPT></HEAD>
    <BODY> Load 04.htm into _R </BODY>
    </HTML>
    [/HTML]

    <! 04.htm

    [HTML]<HTML>
    <HEAD><TITLE>&n bsp</TITLE></HEAD>
    <BODY> This is 04.htm in _R loaded from _L </BODY>
    </HTML>[/HTML]
    Last edited by acoder; Apr 4 '08, 11:27 AM. Reason: Added code tags
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    #2
    Back slashes are not used here.
    Replace sub\ with sub/


    Harpreet

    Comment

    • wmbrae
      New Member
      • Apr 2008
      • 3

      #3
      Originally posted by hsriat
      Back slashes are not used here.
      Replace sub\ with sub/
      Harpreet
      Thanks to acoder for cleaning up my post.

      Thanks to Harpereet for your response.
      I didn't uderstand it at first, but I tried it out.

      in 02.htm, the \ worked in
      <a href="sub\03.ht m" target="_L">loa d 03.htm into _L</a>
      but based on the response, I changed it to
      <a href="sub/03.htm" target="_L">loa d 03.htm into _L</a>
      it worked also but with the same result the load _R didn't work.

      the big difference was in 03.htm, where i changed

      parent._R.locat ion.href = "04.htm";

      to

      parent._R.locat ion.href = "c:/04.htm";

      the page was loaded.

      Thank-you

      Comment

      • hsriat
        Recognized Expert Top Contributor
        • Jan 2008
        • 1653

        #4
        Try parent._R.src = "04.htm";
        or parent.frames['_R'].src = "04.htm";

        And one more thing. Its &nbsp; not &nbsp (don't forget the semi-colon in the end)

        Regards,
        Harpreet

        Comment

        Working...