Lee David said the following on 7/21/2005 6:36 PM:
[color=blue]
> Thank you. When I reopened the page it lead me directly to the "operator
> error" (my mistake) of not knowing how to spell "document" correctly. Now I
> just need to find out how to get the Netscape browser identified. This
> didn't work:[/color]
Why does it matter if its Netscape, Mozilla, FunkyBrowser or
myBrowserThatIMadeUpTheName? You don't browser detect, you feature detect.
[color=blue]
> if (document.layers)
> {
> alert("**testing** NS");
> var ns4test = true;
> var ie4test = false;
> }
>
> Nor did the more compact:
> ns4test = document.layers?true:false;[/color]
That actually "works", it just doesn't work the way you think it would.
[color=blue]
> Again, thanks for the quick response... I'll put my shoe down and the
> monitor is safe again.[/color]
if (document.layers){
//use the document.layers collection
}
if (document.getElementByID){
//use the getElementByID method
}
if (document.all){
//use the document.all collection
}
And all that without caring what browser it was. This is covered in the
groups FAQ.
And please don't top-post.
--
Randy
comp.lang.javascript FAQ -
http://jibbering.com/faq & newsgroup weekly
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?