E Enumerator object (Object/JScript) The available set (Bulletproof web design)

E Enumerator object (Object/JScript) The available set of methods and properties is somewhat limited compared with enumerator objects in other languages. Because this is only available on MSIE and is severely dysfunctional on the Macintosh version of MSIE 5, its use is somewhat limited from the portability point of view. It is recommended that you avoid using it for the time being. Later, when it is more widely and reliably available, it may be more useful. Do not confuse DOM NodeList arrays with Enumerator or Collection objects. The NodeListitem() method is subtly different to the Enumerator.Item() method. Warnings: . When tested on MSIE 5 for Macintosh, this object exhibited some very odd behavior. . When passed a FormArray, it complained that it was not a Collection object. When passed a Collection object (document.all) it still complained. However, when passed an Array object, it was happy to accept it. It would allow a new Enumerator to be created with no argument being passed to its constructor function. . When examined, its constructor reported that it was a reference to a Date object. . The object may only be usable on MSIE on the Windows platform until a later version of MSIE supports a corrected implementation. . The naming convention for methods and properties of this object are capitalized in a very untypical way and you need to be aware of this in case you have trouble getting your enumerator to work properly. Example code: // Instantiate a file system object myFileSystem = new ActiveXObject(”Scripting.FileSystemObject”); // Create an enumerator myEnum = new Enumerator(myFileSystem.Drives); // Traverse the Drives collection via the enumerator for(; !myEnum.atEnd(); myEnum.moveNext()) { processDrive(myEnum.item()); } // A function to do something with each disk drive function processDrive(aDrive){…} See also: Collection object, Files object, NodeList object Property JavaScript JScript N IE Opera Notes constructor 3.0 + 4.0 + Warning
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision tomcat hosting services

Leave a Reply