Trying to access a JavaScript variable in one frame from another frame.

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

    Trying to access a JavaScript variable in one frame from another frame.

    I know, I know, don't use frames. Well, I'm stuck with these frames and
    I'm trying to add functionality without a complete redsign. You can
    look at this as a nostalgic journey.

    Anyway, I've got the following frame structure at the top level:

    FRAMESET CODE
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
    <html><head><ti tle>Server List</title></head>
    <frameset frameborder="1" border="1" framespacing="1 " rows="10%,89%">
    <frame name="TopFrame"
    src="/rob/serverlist.nsf/TopPage?OpenPag e"
    SCROLLING="No" NORESIZE FRAMEBORDER="No ">
    <frameset cols="16%,83%">
    <frame name="LeftNavFr ame"
    src="/rob/serverlist.nsf/LeftNavPage?Ope nPage&amp;BaseT arget=MainFrame "
    SCROLLING="No" NORESIZE FRAMEBORDER="No ">
    <frameset rows="8%,91%">
    <frame name="ViewContr ols"
    src="/rob/serverlist.nsf/by%20Server%20N ame?OpenPage&am p;BaseTarget=Ma inFrame"
    SCROLLING="No" NORESIZE FRAMEBORDER="No ">
    <frame frameborder="0" name="MainFrame "
    src="/rob/serverlist.nsf/by%20Server%20N ame?OpenView">
    </frameset>
    </frameset>
    </frameset></html>

    I'm trying to pickup the value of a JavaScript variable I set in one
    frame from another frame. Here's the details.

    In frame 'MainFrame' I have this code (it makes use of prototype.js to
    fetch field values but that part of the code works. It just can't seems
    to find code across frames.):
    MAINFRAME CODE FRAGMENT

    ....snip
    <body text="#000000" bgcolor="#E0FFF F" id='viewbody'>
    <form action="">
    <script>var resort = 'RESORT VALUE HERE';</script>
    ....snip

    END MAINFRAME CODE FRAGMENT

    In frame 'ViewControls' I have this code:
    VIEWCONTROLS CODE FRAGMENT

    ....snip
    <script>
    function getFrame(fName) {
    var frames = top.document.ge tElementsByTagN ame("FRAME");
    var frame= null;
    for(var i=0; i < frames.length; i++){
    if(frames[i].name == fName)
    frame = frames[i];
    }
    var forms = frame.getElemen tsByTagName("*" );
    for(var j=0; j < forms.length; j++){
    alert("Got form " + j);
    }
    // for(var n in frame.document. forms[0]){
    // alert("Frame val: " + n + " is " +
    frame.document. forms[0][n]);
    // }
    return null;
    }

    var viewStart = 1;
    function openView(increm ent){
    viewStart = parseInt(viewSt art) + parseInt(increm ent);
    viewStart = (viewStart < 1) ? 1 : viewStart;
    alert("Frame found: " +
    getFrame("MainF rame").document .forms[0].resort);
    window.open($F( 'URLtoOpen') + "&Start=" + viewStart + "&Count="
    +
    $F("Count"), 'MainFrame');
    }

    </script>
    Rows to display:
    <input name="Count" value="1000" id="Count" size="4" maxlength="4">
    <input type="button" onclick="viewSt art=1;openView( 0);" value="First
    Page">
    <input type="button" onclick="openVi ew(-($F('Count'))); "
    value="<<Previo us Page">
    <input type="button" onclick="openVi ew($F('Count')) ;" value="Next
    Page>>">
    <script>openVie w(0);</script>
    ....snip

    END VIEWCONTROLS CODE FRAGMENT
    So the function openView is called when the ViewControls page loads and
    when one of the three buttons is pressed. Right now openView calls
    getFrame("MainF rame") in the alert because I'm testing. getFrame
    successfuly finds "MainFrame" but there I get stuck.

    The DOM still confounds me after reading and working with it (on and
    off) for months. I can not figure out what the hierarchy is of the
    elements. When I use the DOM inspector in FireFox it shows me that
    inside the FRAME with name="MainFrame " is "# document" (what does the #
    mean?). I can trace through the children "document->HTML->BODY->FORM'.
    Isn't this the form where the variable was created? Yet I can not find
    it using the DOM inspector and I've tried everything I can think of in
    the code to find it.

    Clearly I am confused about the scope of things in the DOM. Can anyone
    point me to a book or web site that CLEARLY explains what is where and
    why? (Or any other help.)

    Thanks in advance,

    Rob:-]

  • ASM

    #2
    Re: Trying to access a JavaScript variable in one frame from anotherframe.

    Rob a écrit :[color=blue]
    > I know, I know, don't use frames. Well, I'm stuck with these frames and
    > I'm trying to add functionality without a complete redsign. You can
    > look at this as a nostalgic journey.
    >
    > Anyway, I've got the following frame structure at the top level:
    >
    > FRAMESET CODE
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
    > <html><head><ti tle>Server List</title></head>
    > <frameset frameborder="1" border="1" framespacing="1 " rows="10%,89%">
    > <frame name="TopFrame"
    > src="/rob/serverlist.nsf/TopPage?OpenPag e"
    > SCROLLING="No" NORESIZE FRAMEBORDER="No ">
    > <frameset cols="16%,83%">
    > <frame name="LeftNavFr ame"
    > src="/rob/serverlist.nsf/LeftNavPage?Ope nPage&amp;BaseT arget=MainFrame "
    > SCROLLING="No" NORESIZE FRAMEBORDER="No ">
    > <frameset rows="8%,91%">
    > <frame name="ViewContr ols"
    > src="/rob/serverlist.nsf/by%20Server%20N ame?OpenPage&am p;BaseTarget=Ma inFrame"
    > SCROLLING="No" NORESIZE FRAMEBORDER="No ">
    > <frame frameborder="0" name="MainFrame "
    > src="/rob/serverlist.nsf/by%20Server%20N ame?OpenView">
    > </frameset>
    > </frameset>
    > </frameset></html>
    >
    > I'm trying to pickup the value of a JavaScript variable I set in one
    > frame from another frame. Here's the details.
    >
    > In frame 'MainFrame' I have this code (it makes use of prototype.js to
    > fetch field values but that part of the code works. It just can't seems
    > to find code across frames.):
    > MAINFRAME CODE FRAGMENT
    >
    > ...snip
    > <body text="#000000" bgcolor="#E0FFF F" id='viewbody'>
    > <form action="">
    > <script>var resort = 'RESORT VALUE HERE';</script>
    > ...snip
    >
    > END MAINFRAME CODE FRAGMENT
    >
    > In frame 'ViewControls' I have this code:
    > VIEWCONTROLS CODE FRAGMENT
    >
    > ...snip
    > <script>
    > function getFrame(fName) {
    > var frames = top.document.ge tElementsByTagN ame("FRAME");[/color]

    var frames = top.frames;
    [color=blue]
    > var frame= null;
    > for(var i=0; i < frames.length; i++){
    > if(frames[i].name == fName)
    > frame = frames[i];
    > }
    > var forms = frame.getElemen tsByTagName("*" );[/color]

    var forms = frame.document. forms;
    or
    var forms = frame.document. getElementsByTa gName("*");
    but will not be your forms (all tags)
    so :
    var forms = frame.document. getElementsByTa gName("FORM");
    ^^^^^^^^ ^^^^
    [color=blue]
    > for(var j=0; j < forms.length; j++){
    > alert("Got form " + j);[/color]

    alert('got tag '+j+' - tagname = '+forms[j].tagName);

    [color=blue]
    > }
    > // for(var n in frame.document. forms[0]){
    > // alert("Frame val: " + n + " is " +
    > frame.document. forms[0][n]);[/color]

    non sense : you don't know if you are in a form
    (could be body or div or...)
    [color=blue]
    > // }
    > return null;
    > }[/color]

    [snip]

    --
    Stephane Moriaux et son [moins] vieux Mac

    Comment

    • Rob

      #3
      Re: Trying to access a JavaScript variable in one frame from another frame.

      I've messed up my code trying to get something to work. I tried your
      code like this:

      function getFrame(fName) {
      var frames = top.document.ge tElementsByTagN ame("FRAME");
      var frame= null;
      for(var i=0; i < frames.length; i++){
      if(frames[i].name == fName)
      frame = frames[i];
      }
      var forms = frame.document. forms;
      alert("Got this many forms: " + forms.length); // Should be one
      un-named form
      return null;
      }

      On this line: var forms = frame.document. forms
      I get the error message, "frame.docu ment has no properties".
      That is my problem in a nutshell. The DOM inspector shows that frame
      has one property it labels as "# document". (What does the # mean?)

      That's where I'm stuck.

      Thanks for helping.

      Rob:-]

      Comment

      • Richard Cornford

        #4
        Re: Trying to access a JavaScript variable in one frame from another frame.

        Rob wrote:[color=blue]
        > I've messed up my code trying to get something to work. I
        > tried your code like this:
        >
        > function getFrame(fName) {
        > var frames = top.document.ge tElementsByTagN ame("FRAME");
        > var frame= null;
        > for(var i=0; i < frames.length; i++){
        > if(frames[i].name == fName)
        > frame = frames[i];
        > }
        > var forms = frame.document. forms;
        > alert("Got this many forms: " + forms.length); // Should be one
        > un-named form[/color]

        You want to watch letting your posting software wrap your code, as that
        tends to render it syntactically incorrect (so we cannot tell whether
        the incorrectness is in the original or an artefact of poor posting
        style). Generally, arranging that posted code has no lines longer than
        (about) 72 characters (and is indented with (2 to 4) spaces rather than
        tabs) will avoid problems.
        [color=blue]
        > return null;
        > }[/color]
        <snip>

        Window/global objects (in browsers that support frames) have a -
        frames - collection, in which the global/window object of all contained
        frames can be referenced by NAME attribute or integer index. So
        referencing the window/global object of a frame named 'LeftNavFrame' in
        the top frame (the frameset page) from within any contained frame (or
        the top frame itself) could be as simple as - frame =
        top.frames['LeftNavFrame']; -. The resulting reference to the frame's
        window/global object will be a reference to an object with a -
        document - property that contains the document for that frame.

        Richard.


        Comment

        • Rob

          #5
          Re: Trying to access a JavaScript variable in one frame from another frame.


          Richard Cornford wrote:[color=blue]
          > Rob wrote:[/color]
          <snip>[color=blue]
          > You want to watch letting your posting software wrap your code, as that
          > tends to render it syntactically incorrect (so we cannot tell whether
          > the incorrectness is in the original or an artefact of poor posting
          > style). Generally, arranging that posted code has no lines longer than
          > (about) 72 characters (and is indented with (2 to 4) spaces rather than
          > tabs) will avoid problems.[/color]

          Thanks for the tip on posting. I'll try to be more careful in the
          future.

          <snip>[color=blue]
          > Window/global objects (in browsers that support frames) have a -
          > frames - collection, in which the global/window object of all contained
          > frames can be referenced by NAME attribute or integer index. So
          > referencing the window/global object of a frame named 'LeftNavFrame' in
          > the top frame (the frameset page) from within any contained frame (or
          > the top frame itself) could be as simple as - frame =
          > top.frames['LeftNavFrame']; -. The resulting reference to the frame's
          > window/global object will be a reference to an object with a -
          > document - property that contains the document for that frame.[/color]

          Thanks for the tip about finding the frame. However, as I said in my
          post, finding the frame isn't the problem. The code I posted above does
          find the frame. What I can't seem to find is the document in the frame
          or any form in the frame. As I said abouve, that's where I'm stuck.[color=blue]
          >
          > Richard.[/color]

          So here's a quote from my original post which states more clearly where
          I'm stuck and what I'd like in the way of help. I would really like to
          find some documentation on the DOM that clearly tells me what you told
          me and all the other things about the DOM that I don't understand
          without having to beg for help on usenet. I've become skilled at many
          aspects of programming but the DOM still eludes me somehow.

          Rob wrote:
          <snip>[color=blue]
          > So the function openView is called when the ViewControls page loads and
          > when one of the three buttons is pressed. Right now openView calls
          > getFrame("MainF rame") in the alert because I'm testing. getFrame
          > successfuly finds "MainFrame" but there I get stuck.
          >
          > The DOM still confounds me after reading and working with it (on and
          > off) for months. I can not figure out what the hierarchy is of the
          > elements. When I use the DOM inspector in FireFox it shows me that
          > inside the FRAME with name="MainFrame " is "# document" (what does the #
          > mean?). I can trace through the children "document->HTML->BODY->FORM'.
          > Isn't this the form where the variable was created? Yet I can not find
          > it using the DOM inspector and I've tried everything I can think of in
          > the code to find it.
          >
          > Clearly I am confused about the scope of things in the DOM. Can anyone
          > point me to a book or web site that CLEARLY explains what is where and
          > why? (Or any other help.)[/color]
          <snip>

          Peace, Love, Laugher,

          Rob:-]

          Comment

          • Richard Cornford

            #6
            Re: Trying to access a JavaScript variable in one frame from another frame.

            Rob wrote:
            <snip>[color=blue]
            > Thanks for the tip about finding the frame. However,
            > as I said in my post, finding the frame isn't the problem.
            > The code I posted above does find the frame.[/color]

            No it does not. The - top.document.ge tElementsByTagN ame("FRAME"); - call
            returns a collection of FRAME _elements_ in the top document, if you
            what easy access to the documents contained in the frames you should go
            through the window/global object for each frame, so through the -
            frames - collection.
            [color=blue]
            > What I can't seem to find is the document in the
            > frame or any form in the frame.[/color]
            <snip>

            As your collection is a collection of FRAME elements you will not find
            that they have - document - properties except where they do, and those -
            document - properties may refer to the document that contains the
            element (i.e. top.document) on browsers such as IE 5.

            You will find browsers where the FRAME elements have a -
            contentDocument - property that is a reference to the contained
            document, but going through the - frames - collection is as consistent,
            cross-browser and reliable a method as is available.

            Richard.


            Comment

            • Rob

              #7
              Re: Trying to access a JavaScript variable in one frame from another frame.

              Hi Richard,

              Thanks for helping. I've got some questions below.

              Richard Cornford wrote:[color=blue]
              > Rob wrote:
              > <snip>[color=green]
              > > Thanks for the tip about finding the frame. However,
              > > as I said in my post, finding the frame isn't the problem.
              > > The code I posted above does find the frame.[/color]
              >
              > No it does not. The - top.document.ge tElementsByTagN ame("FRAME"); - call
              > returns a collection of FRAME _elements_ in the top document, if you
              > what easy access to the documents contained in the frames you should go
              > through the window/global object for each frame, so through the -
              > frames - collection.[/color]

              Well I know I'm misunderstandin g something. I though frames were frame
              elements. I still don't understand what you are saying. Can you write a
              code snippet that shows me how to return the value from an input with
              id='GetThis' on a frame named MainFrame.
              [color=blue][color=green]
              > > What I can't seem to find is the document in the
              > > frame or any form in the frame.[/color]
              > <snip>
              >
              > As your collection is a collection of FRAME elements you will not find
              > that they have - document - properties except where they do, and those -
              > document - properties may refer to the document that contains the
              > element (i.e. top.document) on browsers such as IE 5.
              >
              > You will find browsers where the FRAME elements have a -
              > contentDocument - property that is a reference to the contained
              > document, but going through the - frames - collection is as consistent,
              > cross-browser and reliable a method as is available.[/color]

              Where is this documented so I can look it up.
              [color=blue]
              >
              > Richard.[/color]

              Comment

              • RobG

                #8
                Re: Trying to access a JavaScript variable in one frame from anotherframe.

                Rob wrote:[color=blue]
                > Hi Richard,
                >
                > Thanks for helping. I've got some questions below.
                >
                > Richard Cornford wrote:[color=green]
                >> Rob wrote:
                >> <snip>[color=darkred]
                >>> Thanks for the tip about finding the frame. However,
                >>> as I said in my post, finding the frame isn't the problem.
                >>> The code I posted above does find the frame.[/color]
                >> No it does not. The - top.document.ge tElementsByTagN ame("FRAME"); - call
                >> returns a collection of FRAME _elements_ in the top document, if you
                >> what easy access to the documents contained in the frames you should go
                >> through the window/global object for each frame, so through the -
                >> frames - collection.[/color]
                >
                > Well I know I'm misunderstandin g something. I though frames were frame
                > elements. I still don't understand what you are saying. Can you write a
                > code snippet that shows me how to return the value from an input with
                > id='GetThis' on a frame named MainFrame.[/color]

                Frames are HTML elements and also DOM objects. The
                document.getEle mentsByTagName( ) method returns a collection, which is a
                DOM object but it isn't a DOM element object or an HTML element.

                <URL:http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-75708506>

                e.g. (in the example I'll use divs because it's simpler, frames work the
                same way for getElementsByTa gName())

                <html><title>Te st getElementsByTa gName</title>
                <div id="firstDiv">h ere is a div</div>
                <div id="secondDiv"> here is another div</div>

                <script type="text/javascript">
                var divs = document.getEle mentsByTagName( 'div');
                alert(
                'There are ' + divs.length + ' divs'
                + '\nThe first has id ' + divs[0].id
                + '\nThe scond has id ' + divs[1].id
                );
                </script>
                </html>

                In the above, document.getEle mentsByTagName( 'div') returns a collection
                of the two divs. A reference to the collection is assigned to the
                variable 'divs'.

                To access the first div, use divs[0] and to access the second use divs[1].

                A collection is a bit like an array - it has a special length property
                and the members can be accessed by index. If there is only one frame in
                a document, then:

                var f = document.getEle mentsByName('fr ame')

                will return a collection with a length of one. To access that element,
                use - f[0] - just like an array (but please remember, collections aren't
                arrays).

                [color=blue][color=green][color=darkred]
                >>> What I can't seem to find is the document in the
                >>> frame or any form in the frame.[/color]
                >> <snip>
                >>
                >> As your collection is a collection of FRAME elements you will not find
                >> that they have - document - properties except where they do, and those -
                >> document - properties may refer to the document that contains the
                >> element (i.e. top.document) on browsers such as IE 5.
                >>
                >> You will find browsers where the FRAME elements have a -
                >> contentDocument - property that is a reference to the contained
                >> document, but going through the - frames - collection is as consistent,
                >> cross-browser and reliable a method as is available.[/color]
                >
                > Where is this documented so I can look it up.[/color]

                Rather than using the document.getEle mentsByTagName( ) method, some
                browsers (e.g. IE) have a document.frames collection which is similar to
                other collections like document.images and document.links.

                Unfortunately, the frames collection isn't part of the W3C DOM 2 HTML
                specification and it isn't supported by all browsers - e.g. Firefox.

                The properties of the HTMLDocument interface are here:

                <URL:http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268>

                There are a number of collections:

                readonly attribute HTMLCollection images;
                readonly attribute HTMLCollection applets;
                readonly attribute HTMLCollection links;
                readonly attribute HTMLCollection forms;
                readonly attribute HTMLCollection anchors;


                'frames' isn't among them.


                --
                Rob
                Group FAQ: <URL:http://www.jibbering.c om/faq/>

                Comment

                • RobG

                  #9
                  Re: Trying to access a JavaScript variable in one frame from anotherframe.

                  RobG wrote:
                  [...][color=blue]
                  > A collection is a bit like an array - it has a special length property
                  > and the members can be accessed by index. If there is only one frame in
                  > a document, then:
                  >
                  > var f = document.getEle mentsByName('fr ame')
                  >
                  > will return a collection with a length of one. To access that element,
                  > use - f[0] - just like an array (but please remember, collections aren't
                  > arrays).[/color]

                  Forgot to mention that collections are also 'live'. If you add another
                  div, it is automatically added to the collection, you don't have to do
                  getElementsByTa gName('div') again to update it:


                  <div id="firstDiv">h ere is a div</div>
                  <div id="secondDiv"> here is another div</div>

                  <script type="text/javascript">

                  var divs = document.getEle mentsByTagName( 'div');

                  alert(divs.leng th); // Shows 2

                  var d = document.create Element('div');
                  document.body.a ppendChild(d);

                  alert(divs.leng th); // Shows 3

                  </script>


                  [...]


                  --
                  Rob
                  Group FAQ: <URL:http://www.jibbering.c om/faq/>

                  Comment

                  • Richard Cornford

                    #10
                    Re: Trying to access a JavaScript variable in one frame from another frame.

                    RobG wrote:
                    <snip>[color=blue]
                    > Rather than using the document.getEle mentsByTagName( )
                    > method, some browsers (e.g. IE) have a document.frames
                    > collection[/color]

                    I was not proposing the use of the - document.frames - collection at all
                    (as it is not cross-browser), I was proposing the use of the global -
                    frames - collection. The - frames - collection (the global one or the
                    document one) are not related to - getElementsByTa gName - at all as they
                    are collections of window/global objects not a collection of elements.
                    [color=blue]
                    > which is similar to other collections like document.images
                    > and document.links.
                    >
                    > Unfortunately, the frames collection isn't part of the W3C
                    > DOM 2 HTML specification and[/color]

                    The W3C DOM specifications do not mandate any properties of the global
                    object in HTML web browsers.
                    [color=blue]
                    > it isn't supported by all browsers - e.g. Firefox.[/color]

                    The global - frames - collection is supported by all browsers that
                    understand frames, including Firefox. If that were not the case it would
                    not be the most consistent and cross browser method of accessing the
                    content of frames.

                    Richard.


                    Comment

                    • RobG

                      #11
                      Re: Trying to access a JavaScript variable in one frame from anotherframe.

                      Richard Cornford wrote:[color=blue]
                      > RobG wrote:
                      > <snip>[color=green]
                      >> Rather than using the document.getEle mentsByTagName( )
                      >> method, some browsers (e.g. IE) have a document.frames
                      >> collection[/color]
                      >
                      > I was not proposing the use of the - document.frames - collection at all
                      > (as it is not cross-browser), I was proposing the use of the global -
                      > frames - collection. The - frames - collection (the global one or the
                      > document one) are not related to - getElementsByTa gName - at all as they
                      > are collections of window/global objects not a collection of elements.
                      >[color=green]
                      >> which is similar to other collections like document.images
                      >> and document.links.
                      >>
                      >> Unfortunately, the frames collection isn't part of the W3C
                      >> DOM 2 HTML specification and[/color]
                      >
                      > The W3C DOM specifications do not mandate any properties of the global
                      > object in HTML web browsers.
                      >[color=green]
                      >> it isn't supported by all browsers - e.g. Firefox.[/color]
                      >
                      > The global - frames - collection is supported by all browsers that
                      > understand frames, including Firefox. If that were not the case it would
                      > not be the most consistent and cross browser method of accessing the
                      > content of frames.[/color]

                      Ah yes... oops :-x I guess that's what comes of never using them.

                      And to answer the OP's question: "Where is it documented":

                      Gecko DOM page:
                      <URL:http://developer.mozil la.org/en/docs/DOM:window.fram es>

                      MSDN HTML and DHTML page:
                      <URL:http://msdn.microsoft. com/workshop/author/dhtml/reference/collections/frames.asp>


                      --
                      Rob
                      Group FAQ: <URL:http://www.jibbering.c om/faq/>

                      Comment

                      • Rob

                        #12
                        Re: Trying to access a JavaScript variable in one frame from another frame.

                        Thanks for your help. Especially RobG for pointing me to the Mozilla
                        Developers web site.

                        I now have working code and here it is:

                        function getFieldValueFr omFrame(frameNa me, fieldId){
                        var frames = top.frames
                        for(var i=0, fl = frames.length; i < fl; i++)
                        if(frames[i].name == frameName)
                        return frames[i].document.getEl ementById(field Id).value;
                        return "";
                        }

                        However this page,
                        Returns the window itself, which is an array-like object, listing the direct sub-frames of the current window.

                        Says, "DOM Level 0. Not part of specification" so I'm thinking that my
                        original code would be more W3C complient. But I was wrong. Here's that
                        non-working code:

                        function getFieldValueFr omFrame(frameNa me, fieldId){
                        // var frames = top.frames
                        var frames = top.document.ge tElementsByTagN ame("FRAME");
                        for(var i=0, fl = frames.length; i < fl; i++)
                        if(frames[i].name == frameName)
                        return frames[i].document.getEl ementById(field Id).value;
                        return "";
                        }

                        This give the error, "frames[i].document has no properties." This page
                        http://developer.mozilla.org/en/docs/DOM:window.frames says, "Returns
                        an array of the subframes in the current window" and "frameList =
                        window.frames; frameList is an array of frame objects".

                        This page
                        The MDN Web Docs site provides information about Open Web technologies including HTML, CSS, and APIs for both Web sites and progressive web apps.

                        says, "Returns a list of the descendant elements of a given name on the
                        current element." Since both versions find the frame I'm look for, I
                        conclude that both are returning essencially the same data.

                        However I also conclude that the elements returned by
                        getElementsByTa gName and the objects in window.frames are not exactly
                        the same. But what is the difference and where is this difference
                        documented? It is a part of my knowledge-base that is missing:)

                        Again, thanks for all your help.

                        Rob:-]

                        Rob wrote:[color=blue]
                        > I know, I know, don't use frames. Well, I'm stuck with these frames and
                        > I'm trying to add functionality without a complete redsign. You can
                        > look at this as a nostalgic journey.
                        >
                        > Anyway, I've got the following frame structure at the top level:[/color]

                        <snip my non-working code>
                        [color=blue]
                        > Clearly I am confused about the scope of things in the DOM. Can anyone
                        > point me to a book or web site that CLEARLY explains what is where and
                        > why? (Or any other help.)
                        >
                        > Thanks in advance,
                        >
                        > Rob:-][/color]

                        Comment

                        Working...