Cross-browser question: making Netscape recognize frames within document within frame within frame

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David Hayes

    #1

    Cross-browser question: making Netscape recognize frames within document within frame within frame

    I tried finding an answer on http://www.quirksmode.org/ without success.

    I am attempting a complicated Frames structure. I have made it work in IE,
    but not Netscape.

    I begin with three frames, where the two lower ones are within a Frameset
    within the master Frameset:

    111111111111111 1111

    2 333333333333333 3
    2 333333333333333 3
    2 333333333333333 3

    I can change the URL of the content of any of the three frames with commands
    such as these:

    parent.frames[0].location='mast head.html';
    parent.frames[2].location='side bar.html#068';
    parent.frames[3].location='main space.html#068' ;"

    These work in Netscape as well as IE.

    The cross-browser differences begin after I split up frame 3 into more
    frames. I do this (upon a user click) by loading into frame 3 an HTML file
    that is nothing but code for a new frameset. The frameset divides this
    window into three columns. Each column loads with an HTML file inside it.

    Even here, Netscape and IE both load the new page and display the new
    content. The trouble is when I try to substitute new files for the ones in
    these sub-frames. IE does what I want, Netscape remains frozen.

    To change the content of the frames within the document within the #3 frame
    (which itself is within a frameset within a frameset within the master
    window), I use:

    parent.frames[2].frames[0].location='Prod ucer.html#E1'
    or:
    parent.frames[2].frames[2].location='reas ons.html#C2'

    I have also been able to use:

    parent.frames[2].document.frame s[0].location='Prod ucer.html#E1'
    or:
    parent.frames[2].document.frame s[2].location='reas ons.html#C2'

    And even:

    parent.parent.f rames[2].frames[0].location='Prod ucer.html#E1'

    IE handles them all. Netscape doesn't do anything. Is there a way of
    addressing these inner frames via Netscape that I have failed to consider?

    --
    David Hayes

    (remove the name of the programming language from email address to make it
    usable)


  • Martin Honnen

    #2
    Re: Cross-browser question: making Netscape recognize frames withindocument within frame within frame



    David Hayes wrote:

    [color=blue]
    > I am attempting a complicated Frames structure. I have made it work in IE,
    > but not Netscape.
    >
    > I begin with three frames, where the two lower ones are within a Frameset
    > within the master Frameset:
    >
    > 111111111111111 1111
    >
    > 2 333333333333333 3
    > 2 333333333333333 3
    > 2 333333333333333 3[/color]

    How about posting the relevant HTML instead of ASCII art?
    [color=blue]
    > I can change the URL of the content of any of the three frames with commands
    > such as these:
    >
    > parent.frames[0].location='mast head.html';
    > parent.frames[2].location='side bar.html#068';
    > parent.frames[3].location='main space.html#068' ;"
    >
    > These work in Netscape as well as IE.[/color]

    If you have three frames then parent.frames[3] is not null?

    Anyway, frames can be given names and then referenced by name which
    might be safer then finding the proper index. So you could try
    <frame name="frameName " ...>
    and then
    if (parent.frames && parent.frames.f rameName) {
    parent.frames.f rameName.locati on.href = ...
    }
    [color=blue]
    > The cross-browser differences begin after I split up frame 3 into more
    > frames. I do this (upon a user click) by loading into frame 3 an HTML file
    > that is nothing but code for a new frameset. The frameset divides this
    > window into three columns. Each column loads with an HTML file inside it.
    >
    > Even here, Netscape and IE both load the new page and display the new
    > content. The trouble is when I try to substitute new files for the ones in
    > these sub-frames. IE does what I want, Netscape remains frozen.[/color]

    Have you checked the Netscape JavaScript console? Does it show errors?
    [color=blue]
    > To change the content of the frames within the document within the #3 frame
    > (which itself is within a frameset within a frameset within the master
    > window), I use:
    >
    > parent.frames[2].frames[0].location='Prod ucer.html#E1'
    > or:
    > parent.frames[2].frames[2].location='reas ons.html#C2'[/color]

    As said it might help to name frames and then use the names instead of
    the index.
    [color=blue]
    > I have also been able to use:
    >
    > parent.frames[2].document.frame s[0].location='Prod ucer.html#E1'[/color]

    document.frames is IE object model stuff so that will surely give errors
    in the Netscape JavaScript console.

    If naming frames doesn't help I suggest you post a URL where we can
    visit the problem, but check the JavaScript console and tell us about
    the error messages you get. And clearly identify what needs to be done
    to trigger the error, where/how you call your frame location change code
    (e.g. on button click or directly onload, could be simply a problem with
    sibling frames not being accessible then).


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/

    Comment

    • David Hayes

      #3
      Re: Cross-browser question: making Netscape recognize frames within document within frame within frame

      "Martin Honnen" <mahotrash@yaho o.de> wrote in message
      news:41ee8039$0 $822$9b4e6d93@n ewsread2.arcor-online.net...[color=blue]
      >
      >
      > David Hayes wrote:
      >
      >[color=green]
      > > I am attempting a complicated Frames structure. I have made it work in[/color][/color]
      IE,[color=blue][color=green]
      > > but not Netscape.
      > >
      > > I begin with three frames, where the two lower ones are within a[/color][/color]
      Frameset[color=blue][color=green]
      > > within the master Frameset:
      > >
      > > 111111111111111 1111
      > >
      > > 2 333333333333333 3
      > > 2 333333333333333 3
      > > 2 333333333333333 3[/color]
      >
      > How about posting the relevant HTML instead of ASCII art?[/color]

      Here goes:

      <FRAMESET ROWS="85,*" frameborder="0" border="0"
      framespacing="0 ">
      <FRAME SRC="masthead.h tml" noresize scrolling="no"
      marginheight="0 ">
      <FRAMESET COLS="33%,67%" frameborder="0" border="0"
      framespacing="0 ">
      <FRAME frameborder="0" border="0" framespacing="0 "
      marginwidth="10 " marginheight="1 0" SRC="sidebar.ht ml"
      name="sidebar" scrolling="auto ">
      <FRAME frameborder="0" border="0" framespacing="0 "
      marginwidth="10 " marginheight="0 " SRC="mainspace. html"
      name="mainspace " noresize scrolling="auto ">
      </FRAMESET>
      </FRAMESET>
      [color=blue][color=green]
      > > I can change the URL of the content of any of the three frames with[/color][/color]
      commands[color=blue][color=green]
      > > such as these:
      > >
      > > parent.frames[0].location='mast head.html';
      > > parent.frames[2].location='side bar.html#068';
      > > parent.frames[3].location='main space.html#068' ;"
      > >
      > > These work in Netscape as well as IE.[/color]
      >
      > If you have three frames then parent.frames[3] is not null?[/color]

      In that frames [2] and [3] are inside [1], the above referents work.
      frames[1] is never used because it contains the other two and thus has no
      room to display HTML of its own. (Anyway, this part of the code works in
      both NS and IE.)
      [color=blue]
      > Anyway, frames can be given names and then referenced by name which
      > might be safer then finding the proper index. So you could try
      > <frame name="frameName " ...>
      > and then
      > if (parent.frames && parent.frames.f rameName) {
      > parent.frames.f rameName.locati on.href = ...
      > }[/color]

      Actually, I have tried this. Note the names "sidebar" and "mainspace"
      above. (Read on to see where what I'm doing now is different from what I
      tried in the past.
      [color=blue][color=green]
      > > The cross-browser differences begin after I split up frame 3 into more
      > > frames. I do this (upon a user click) by loading into frame 3 an HTML[/color][/color]
      file[color=blue][color=green]
      > > that is nothing but code for a new frameset. The frameset divides this
      > > window into three columns. Each column loads with an HTML file inside[/color][/color]
      it.[color=blue][color=green]
      > >
      > > Even here, Netscape and IE both load the new page and display the new
      > > content. The trouble is when I try to substitute new files for the ones[/color][/color]
      in[color=blue][color=green]
      > > these sub-frames. IE does what I want, Netscape remains frozen.[/color]
      >
      > Have you checked the Netscape JavaScript console? Does it show errors?[/color]

      No. My question: would the fact that the errors are occurring within a
      document *within* the main document affect this outcome?
      [color=blue][color=green]
      > > To change the content of the frames within the document within the #3[/color][/color]
      frame[color=blue][color=green]
      > > (which itself is within a frameset within a frameset within the master
      > > window), I use:
      > >
      > > parent.frames[2].frames[0].location='Prod ucer.html#E1'
      > > or:
      > > parent.frames[2].frames[2].location='reas ons.html#C2'[/color]
      >
      > As said it might help to name frames and then use the names instead of
      > the index.
      >[color=green]
      > > I have also been able to use:
      > >
      > > parent.frames[2].document.frame s[0].location='Prod ucer.html#E1'[/color]
      >
      > document.frames is IE object model stuff so that will surely give errors
      > in the Netscape JavaScript console.[/color]

      I have tried to work this by addressing the frames by a name, but not until
      the thinking-through this issue that came with the writing of these two
      newsgroup posts have I wondered whether it would work to address the frame
      by TWO names, such as [...].document['documentName'].frame['mainspace']

      That now being said, if the response given here is correct -- that
      document.frames is IE without NS support -- mightn't the be no
      direct-equivalent solution?
      [color=blue]
      > If naming frames doesn't help I suggest you post a URL where we can
      > visit the problem, but check the JavaScript console and tell us about
      > the error messages you get. [...][/color]

      Before I do, I'd like to pose the question as to whether there is a simple
      difference as to whether the frame[n].frame[n], frame[n].document[n],
      document[n].frame[n] structures of IE have equivalents in NS. If there are,
      I can proceed on my own and report back the success (if any) and what (if
      anything) I had to tweak to make this happen. (My proceeding on my own will
      save anyone else the effort of trudging through a lot of other functions
      within the URL, wherein a lot else is going on.)

      --
      David Hayes

      (remove the name of the programming language from email address to make it
      usable)




      Comment

      • Mark Preston

        #4
        Re: Cross-browser question: making Netscape recognize frames withindocument within frame within frame

        David Hayes wrote:[color=blue]
        > I tried finding an answer on http://www.quirksmode.org/ without success.
        >
        > I am attempting a complicated Frames structure. I have made it work in IE,
        > but not Netscape.
        >
        > I begin with three frames, where the two lower ones are within a Frameset
        > within the master Frameset:
        >[/color]
        I almost hate to mention this, but has no-one told you that users
        actually hate frames anyway and that they are not a very good way of
        doing pretty much anything at all in a browser? Seriously, although
        there may be an answer to your specific question, if I were you I would
        redesign the page and get rid of all the frames.

        Comment

        • Martin Honnen

          #5
          Re: Cross-browser question: making Netscape recognize frames withindocument within frame within frame



          David Hayes wrote:

          [color=blue]
          > I'd like to pose the question as to whether there is a simple
          > difference as to whether the frame[n].frame[n], frame[n].document[n],
          > document[n].frame[n] structures of IE have equivalents in NS.[/color]

          A window (and a frame object is a window object too) has a property
          named frames in both IE and Netscape, that property is a collection
          allowing to access contained frames by index or by name. The property
          named frames of the document object is not available in Netscape.


          --

          Martin Honnen
          http://JavaScript.FAQTs.com/

          Comment

          • David Hayes

            #6
            Re: Cross-browser question: making Netscape recognize frames within document within frame within frame

            > I almost hate to mention this, but has no-one told you that users[color=blue]
            > actually hate frames anyway and that they are not a very good way of
            > doing pretty much anything at all in a browser?[/color]

            I contend that frames, when implemented responsibly and under appropriate
            circumstances, enhances the user experience. Take for example a site that
            offers vocabulary and definitions. A page designed with frames could have
            the vocabulary terms in a scrollable list in the left frame. When the user
            clicks a term, the definition could show up in the right-side frame. The
            benefits to the user come when the user selects a second, third and fourth
            (etc.) term to see defined. The list of terms is already on the page. The
            user doesn't have to click the "back" button to leave the second page (which
            would have the first definition), wait for the reloading of the first page,
            then find his place on the list before he can click a term anew. As a user,
            I know that I dislike waiting for a page to reload when I could have had the
            information stay in place during the time before I return to it, if it's
            likely I will return to it.

            Some might object that in circumstances such as this, all of the information
            should be on one page. This solution might be impractical. A page with
            dozens (even hundreds) of terms *and* their definitions might be over 100K.
            The initial loading would take a long time. If the user wants to click just
            a handful of select terms, that's a lot of wasted bandwidth. With the
            two-frame solution, fewer bytes are transferred. The definitions might be
            spread over a dozen or more HTML documents. (When I've done something like
            this in the past, that's how many pages I had. The answers can be divided
            into individual files for "A-B," "C-D," "E-F," etc. Files for answers for
            terms starting with letters not selected at all by a particular user, would
            never be downloaded from the server for that user.)

            In a single-frame equivalent to this, listing the definitions directly
            beside or beneath a term would mean that the definitions would be visible to
            a wandering eye a split-second after the user sees a term for the first
            time. This is not ideal for classroom situations where it's desirable for a
            student to think about an unfamiliar word before mulling over what his
            existing knowledge leads him to think it might mean. Withholding a
            definition until a user click brings about the desirable. Even if the page
            were configured so that the user has to click a link which takes him further
            down the page where the definition is (as often happens in Q&A formats),
            then clicks a link to return to where he was, we're again talking about a
            much larger initial download than necessary.

            (For what it's worth, I suggest that in a case such as this, the list of
            terms be put in a frame set at a fixed width of 200 pixels, with the
            right-side frame getting the remainder of the frame, so that people with
            bigger screens don't see a whole lot of blank space to the right of the list
            of terms.)

            --
            David Hayes

            (remove the name of the programming language from email address to make it
            usable)


            Comment

            • David Hayes

              #7
              Re: Cross-browser question: making Netscape recognize frames within document within frame within frame

              "Martin Honnen" <mahotrash@yaho o.de> wrote in message
              news:41f1355f$0 $17602$9b4e6d93 @newsread4.arco r-online.net...[color=blue]
              > David Hayes wrote:[color=green]
              > > I'd like to pose the question as to whether there is a simple
              > > difference as to whether the frame[n].frame[n], frame[n].document[n],
              > > document[n].frame[n] structures of IE have equivalents in NS.[/color]
              >
              > A window (and a frame object is a window object too) has a property
              > named frames in both IE and Netscape, that property is a collection
              > allowing to access contained frames by index or by name. The property
              > named frames of the document object is not available in Netscape.[/color]

              This actually provides useful information. As I've stated before, I have
              working in IE a setup where I have frames and framesets. Inside one of the
              embedded frames (let's call it "mainspace" ), I load a particular HTML
              document (let's call it the "inner frameset" document) that itself contains
              three vertical frames. I manipulate the contents of these three frames in
              IE, but haven't been able to replicate this in NS.

              If my failure is attributable to NS not recognizing my instructions for
              document[n].frame[n] content *within* the master window, then a workaround
              is to directly target the HTML document that is itself inside this
              "mainspace" frame. One thing I had not considered trying is to remove the
              "inner frameset" HTML document, reloading it's content, then reloading it as
              the "new" content of "mainspace. " At the least, I might trying reloading
              the content and then generating a "refresh" instruction upon the "inner
              frameset" document or on the whole window.

              --
              David Hayes

              (remove the name of the programming language from email address to make it
              usable)


              Comment

              • Mark Preston

                #8
                Re: Cross-browser question: making Netscape recognize frames withindocument within frame within frame

                David Hayes wrote:[color=blue][color=green]
                >>I almost hate to mention this, but has no-one told you that users
                >>actually hate frames anyway and that they are not a very good way of
                >>doing pretty much anything at all in a browser?[/color]
                >
                >
                > I contend that frames, when implemented responsibly and under appropriate
                > circumstances, enhances the user experience. Take for example a site that[/color]

                Oh, I agree with the advantages of the effects you are discussing. My
                apologies if that was not clear. My point was that the same can be done
                using much easier <div> layers, which are far easier to handle.

                Comment

                Working...