Retrieve an array of tags in Communicator (NS4)?

Discussion in 'Javascript' started by MyndPhlyp, Nov 9, 2004.

  1. MyndPhlyp

    MyndPhlyp Guest

    For IE, I can retrieve an array of tags using:

    document.all.tags("tagname")

    For NS6 & 7 I can use:

    document.getElementsByTagName("tagname")

    Is there an equivalent for that ancient NS Communicator 4?
     
    MyndPhlyp, Nov 9, 2004
    #1
    1. Advertising

  2. MyndPhlyp

    Grant Wagner Guest

    MyndPhlyp wrote:

    > For IE, I can retrieve an array of tags using:
    >
    > document.all.tags("tagname")
    >
    > For NS6 & 7 I can use:
    >
    > document.getElementsByTagName("tagname")
    >
    > Is there an equivalent for that ancient NS Communicator 4?


    No. However, setting the position CSS style explicitly adds
    pretty much every tag to the document.layers[] collection. It's
    sort of useless though, since you can't directly access or
    manipulate the text in that tag.

    <body onload="test();">
    <b style="position:relative;">Test</b>
    <b style="position:relative;">Another Test</b>
    <script type="text/javascript">
    function test() {
    alert(document.layers[0].clip.width + ';' +
    document.layers[1].clip.width);
    }
    </script>
    </body>

    In Netscape 4.78, you see "30;88", which seems to indicate you
    are obtaining the width of the first and second <b>.

    You can also access the CSS style of any type of tag using
    document.tags.{tagName}, for example
    document.tags.H1.color="blue"; Unfortunately, this will not
    change the style dynamically, it's only useful at load time (ie -
    in the <head></head> before any content actually loads).

    --
    Grant Wagner <>
    comp.lang.javascript FAQ - http://jibbering.com/faq
     
    Grant Wagner, Nov 10, 2004
    #2
    1. Advertising

  3. MyndPhlyp

    MyndPhlyp Guest

    "Grant Wagner" <> wrote in message
    news:...
    > MyndPhlyp wrote:
    >
    > > For IE, I can retrieve an array of tags using:
    > >
    > > document.all.tags("tagname")
    > >
    > > For NS6 & 7 I can use:
    > >
    > > document.getElementsByTagName("tagname")
    > >
    > > Is there an equivalent for that ancient NS Communicator 4?

    >
    > No. However, setting the position CSS style explicitly adds
    > pretty much every tag to the document.layers[] collection. It's
    > sort of useless though, since you can't directly access or
    > manipulate the text in that tag.
    >
    > <body onload="test();">
    > <b style="position:relative;">Test</b>
    > <b style="position:relative;">Another Test</b>
    > <script type="text/javascript">
    > function test() {
    > alert(document.layers[0].clip.width + ';' +
    > document.layers[1].clip.width);
    > }
    > </script>
    > </body>
    >
    > In Netscape 4.78, you see "30;88", which seems to indicate you
    > are obtaining the width of the first and second <b>.
    >
    > You can also access the CSS style of any type of tag using
    > document.tags.{tagName}, for example
    > document.tags.H1.color="blue"; Unfortunately, this will not
    > change the style dynamically, it's only useful at load time (ie -
    > in the <head></head> before any content actually loads).
    >
    > --
    > Grant Wagner <>
    > comp.lang.javascript FAQ - http://jibbering.com/faq


    Right after hitting the Send I noticed I had "stupidity" mode still enabled.
    Not nearly enough coffee. I shortly realized that what I wanted just doesn't
    exist in Communicator no matter what I try. Some day I'll actually start
    remembering all those things that can't be done with that old hack.

    What I am going after is the <link> tags in the <head> section. The intent
    was to use the <link> tags to act as a source for a sidebar menu written in
    client-side JavaScript. Yes, there are browser add-ons that provide the same
    functionality however they tend also to be cluttered with other junk and I
    was after a specific look and feel. All I needed was to get read access to
    the information in the <link> tags, snatch the "rel", "href" and "title"
    values, maybe respect the "media" and "type" values to weed out stylesheets
    and bookmarks, and spew out a series of <a>'s to build the menu on-the-fly.
     
    MyndPhlyp, Nov 10, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tim
    Replies:
    14
    Views:
    680
    Marc Nadeau
    Jun 2, 2004
  2. Thom Anderson
    Replies:
    0
    Views:
    486
    Thom Anderson
    Jul 9, 2006
  3. stefano1969

    Live Communicator Server

    stefano1969, Nov 6, 2006, in forum: Java
    Replies:
    2
    Views:
    327
    Tom Forsmo
    Nov 6, 2006
  4. cyril

    <embed> and NS4

    cyril, Aug 1, 2003, in forum: Javascript
    Replies:
    0
    Views:
    83
    cyril
    Aug 1, 2003
  5. Daniel

    ns4,6,ie5,6 and mozilla

    Daniel, Oct 15, 2003, in forum: Javascript
    Replies:
    6
    Views:
    108
    Daniel van den Oord
    Oct 15, 2003
Loading...

Share This Page