Re: "error on page"
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: "error on page"

From: Randy Webb <HikksNotAtHome@aol.com>
Date: Fri Jul 22 2005 - 00:45:34 CEST

Lee David said the following on 7/21/2005 6:36 PM:

> 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:

Why does it matter if its Netscape, Mozilla, FunkyBrowser or
myBrowserThatIMadeUpTheName? You don't browser detect, you feature detect.

> if (document.layers)
> {
> alert("**testing** NS");
> var ns4test = true;
> var ie4test = false;
> }
>
> Nor did the more compact:
> ns4test = document.layers?true:false;

That actually "works", it just doesn't work the way you think it would.

> Again, thanks for the quick response... I'll put my shoe down and the
> monitor is safe again.

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?
Received on Tue Oct 18 02:59:35 2005