Hi, having trouble with Object Detection script from (otherwise excellent) D. Goodman's JS Bible.
It works fine in IE4, NN4 (PC AND Mac), but NN6 (Mac) refuses to do anything once it gets to the initial IF:
The JS console says: 'Uncaught Exception:[Exception... "Too few parameters to method" code 1008' and other other things; locates the error, strangely, in the code for document.all, exactly here according to line number:
I'm just about to give up Netscape6 compatibility (or change the design of the page, but I don't want to do that. If some wiz out there has an answer...
Haven't tested on NN6 PC.
Thanks, sorry for lengthy post.
Here's the full code:
It works fine in IE4, NN4 (PC AND Mac), but NN6 (Mac) refuses to do anything once it gets to the initial IF:
Code:
if (document.getElementById())
The JS console says: 'Uncaught Exception:[Exception... "Too few parameters to method" code 1008' and other other things; locates the error, strangely, in the code for document.all, exactly here according to line number:
Code:
if (document.all)
{
if(typeof obj == 'string')
{
return document.all(obj).style
// ERROR would be HERE ON THIS LINE (?)
}
else
{
return obj.style
}
}
I'm just about to give up Netscape6 compatibility (or change the design of the page, but I don't want to do that. If some wiz out there has an answer...
Haven't tested on NN6 PC.
Thanks, sorry for lengthy post.
Here's the full code:
Code:
function getObject(obj)
{
var theObj
if (document.layers)
{
if(typeof obj == 'string')
{
// just one layer deep
return document.layers[obj]
}
else
{
// can be a nested layer
return obj
}
}
if (document.all)
{
if(typeof obj == 'string')
{
return document.all(obj).style
}
else
{
return obj.style
}
}
if (document.getElementById())
{
if(typeof obj == 'string')
{
return document.getElementById(obj).style
}
else
{
return obj.style
}
}
return null
}