Ian Collins wrote:
RobG wrote: st*********@gmail.com said on 25/04/2006 10:13 PM AEST:
<snip> the error message 'object does not support this
property or method 2146827850'
Does any one know why this problem occurs?
Typically because you are attempting to use a method or property
with an object that doesn't support the method or property. Post a
minimal example that demonstrates the behaviour, then you'll get a
more useful response - maybe. ;-)
Or load the page in FireFox and get a more meaningful error
message...
It is often repeated that IE's error messages are a bit too obscure (and
constantly getting the line numbers off doesn't help much) but it is
maybe a little unfair as IE is at least consistent and once you are used
to its errors you can know what to look for when a particular error
appears.
For example, when IE complains "Object expected" it invariable means
that an attempt was made to call a function with an Identifier that
evaluated as Undefined or Null. That is a compliantly reasonable error
to generate as only functions can be called and functions are a sub-set
of objects so when JScript discovers that a value is not a reference to
an object there is no need to go on to worry about whether that objet
has a [[Call]] method, it can stop at the realisation that the value is
not an object, and announce that.
Granted, JavaScript(tm)'s "'something' is not a function" is more
obvious, but you cannot debug IE specific script issues by trying code
that will take an entirely different branch in an alternative browser.
So learning to match IE's obscure messages with their causes is still a
good idea.
Richard.