Thomas 'PointedEars' Lahn wrote:
br************@hotmail.com wrote:
<snip>
focusControl = document.all['txtArea1'];
If you use document.all, use it as a method (parens),
not as a collection (brackets).
<snip>
Quite the reverse. There are browsers implementing the - document.all -
collection exclusively as an object (rather than as a function object)
so treating the - all - collection as a function will error in those
environments, while all the browsers where the - all - collection can be
called also allow it to be treated as an object, and property accessors
used. And referencing a member of the - all - collection with a property
accessor should be faster as there are inevitable overheads in a
function call.
Generally no collection should be treated as a function, despite the
fact that doing so is usually effective in IE (and directly proposed in
much Microsoft documentation [1]). It is a bad habit to ever get into
and, if done habitually, will become needless barrier to cross-browser
scripting.
Richard.
[1] Microsoft often seem to take the stance that they have won the
browser war, so it is not particularly surprising to find their
documentation proposing practices that would act against cross-browser
coding.