Yes, activeXString is a custom property on the function. Remember, in JavaScript functions are also objects. The function remains in memory until the page is unloaded, so you can add properties to it and retrieve their value later. So calling this function the first time causes the loop to be used in order to determine the correct ActiveX object to use. Once determined, this is cached in the function's activeXString property so all subsequent calls to the function simply return the already-identified correct string.
__________________
Nicholas C. Zakas
Author, Professional JavaScript for Web Developers (ISBN 0764579088)
http://www.nczonline.net/
|