Retrieve an array of tags in Communicator (NS4)?

M

MyndPhlyp

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?
 
G

Grant Wagner

MyndPhlyp said:
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).
 
M

MyndPhlyp

Grant Wagner said:
MyndPhlyp said:
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).

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top