Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Retrieve an array of tags in Communicator (NS4)?

Reply
Thread Tools

Retrieve an array of tags in Communicator (NS4)?

 
 
MyndPhlyp
Guest
Posts: n/a
 
      11-09-2004
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?


 
Reply With Quote
 
 
 
 
Grant Wagner
Guest
Posts: n/a
 
      11-10-2004
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 <(E-Mail Removed)>
comp.lang.javascript FAQ - http://jibbering.com/faq

 
Reply With Quote
 
 
 
 
MyndPhlyp
Guest
Posts: n/a
 
      11-10-2004

"Grant Wagner" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 <(E-Mail Removed)>
> 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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PIX and Nokia Communicator 9500/9300(i) Jyri Korhonen Cisco 1 09-12-2006 06:16 PM
Hi .How to block gadu-gadu communicator ???? Tomek W. Cisco 1 12-01-2005 12:06 PM
VPN with nokia 9500 communicator Marco-L Cisco 0 04-21-2005 01:05 PM
Delphi / Voice Communicator VCL Alistair George VOIP 12 04-05-2005 09:31 PM
Pulver Communicator Derrick Fawsitt VOIP 4 02-04-2005 07:05 AM



Advertisments