Microsoft KB Archive/190243

= PRB: Using Brackets [] to Index an Array of Objects Causes Error =

Article ID: 190243

Article Last Modified on 10/19/2000

-

APPLIES TO


 * Microsoft Internet Explorer 3.02, when used with:
 * Microsoft Windows NT 4.0

-



This article was previously published under Q190243



SYMPTOMS
The Frames property of the Window object is an array of objects for each frame in a window. A user can access a frame by indexing the frames array as in the following example: String1=parent.frames[0].location.href. This example sets String1 to the URL of frame[0]. Using Internet Explorer 3.02 to view this example might cause the following error:

Microsoft JScript runtime error

[Line: 12] 'parent.frames[...].location' is not an object

This error should occur only if all three of the following conditions are met:


 * You are running Internet Explorer 3.02.
 * You are using Jscript.dll version 2.0 or higher.
 * Internet Explorer was installed by a different user than the current logon user.

This problem occurs with any array of objects exposed by the Internet Explorer Object Model, such as anchors, forms, links, elements, and options.



CAUSE
Internet Explorer is looking in the registry under HKEY_CURRENT_USER for the User Agent key (use REGEDIT to look at HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings entry). HKEY_CURRENT_USER is mapped to the logged on user's Security ID number. When Internet Explorer is installed, only the logged on user's SID (Security ID) is updated. When another user logs on, HKEY_CURRENT_USER is now mapped to that user's SID, which was not updated with the User Agent key.



RESOLUTION
Adding the User Agent key to the logged-on user's SID solves the problem. To create a .reg file to update the registry, copy the following text and paste it into an empty Notepad file. Save the file as UserAgent.reg. Double- click the new .reg file to update the registry.

NOTE: Make sure you have Microsoft Internet Explorer 3.02 w/Authenticode 2.0 update installed before using the following file. UserAgent.reg ***************************Cut between these lines********************** REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings] "User Agent"="Mozilla/2.0 (compatible; MSIE 3.02; Update a; AK; Windows  NT)"

************************************************************************  ************************************************************************



Steps to Reproduce Behavior
 Install Internet Explorer 3.02. Make sure the version of Jscript.dll is 2.0 or higher. Log off then log on as a different user.  Load the following HTML page. Array Problem  Number:  Option1</Option> <Option>Option2</Option> <Option>Option3</Option> </Select>

<SCRIPT LANGUAGE="JavaScript">

</SCRIPT> </li></ol>

Additional query words: USERAGENT, JSCRIPT, IE3

Keywords: kbprb KB190243

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.