> 2. The MSDN Library specifies document.all to be a method, not
an object. There is an ambiguity in the IE DOM to allow
collections be referenced like methods and vice-versa, but
I recommend to stick to the documentation:
document.all('Control').customProp = "this";
<url:
http://msdn.microsoft.com/workshop/a...ctions/all.asp />
"all Collection"
....
"Remarks - The all collection includes..."
....
"Standards Information - There is no public standard that applies to this collection."
The MSDN Library documentation clearly does not specify document.all to be a method. The
MSDN Library documentation may use "method-like" syntax for collections, but collections are
clearly documented to be collections, not methods.
To add further weight to the argument that [] are the correct notation to use for IE
collections:
<url:
http://msdn.microsoft.com/workshop/a...s/elements.asp />
indicates the use of FORM.elements(...), yet I doubt the person proposing the use of
document.all() would recommend the use of FORM.elements(), despite their advice to "stick to
the documentation". Continue using document.all[] since it is supported now, and will
continue to be supported long into the future.
--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ -
http://jibbering.com/faq