L
Lee David
How do you track down this to where the error actually is?
TIA, Lee
TIA, Lee
How do you track down this to where the error actually is?
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:
if (document.layers)
{
alert("**testing** NS");
var ns4test = true;
var ie4test = false;
}
Nor did the more compact:
ns4test = document.layers?true:false;
Again, thanks for the quick response... I'll put my shoe down and the
monitor is safe again.
Nor did the more compact:
ns4test = document.layers?true:false;
var supportForLayers = !!document.layers;
The use of !! forces the result to be explicitly true or false and have
the right sense.
Why does it matter if its Netscape, Mozilla, FunkyBrowser or
myBrowserThatIMadeUpTheName? You don't browser detect, you feature detect.
That actually "works", it just doesn't work the way you think it would.
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.
//use the document.layers collection
}
if (document.getElementByID){
//use the getElementByID method
}
if (document.all){
//use the document.all collection
}
Lee said:I'm using <div> to enclose the text that I want to appear. I understand
that Layers is an older and not needed technology. However, the check for
it indicates the usage of NS which used totally different values than IE
does. Therefore, I'm assuming I could use the above and then have code like
this:
if (supportForLayers)
{
turn on the various <div> based on which object incurred the mouseover or
mouseout event using "show"
turn off the various <div> that are not applicable to the triggering event
using "hide"
}
if (supportForAll)
{
turn on the various <div> based on which object incurred the mouseover or
mouseout event using "visible"
turn off the various <div> that are not applicable to the triggering event
using "hidden"
}
Would I need something for Opera, Firefox or other modzilla browsers?
----------------------------^
if ( document.getElementById ){
Case sensitivity's a bitch, eh?
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.