PRB: Using Brackets [] to Index an Array of Objects Causes Error
ID: Q190243
|
The information in this article applies to:
-
Microsoft Internet Explorer (Programming) version 3.02
on the following platforms: NT
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)"
************************************************************************
************************************************************************
MORE INFORMATION
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.
<html>
<head>
<title>Array Problem</title>
</head>
<body>
<form NAME="form1">
Number:
<Select NAME="select1" size="1">
<Option>Option1</Option>
<Option>Option2</Option>
<Option>Option3</Option>
</Select>
</form>
<SCRIPT LANGUAGE="JavaScript">
<!--
alert(document.form1.select1.options[0].text) ;
//-->
</SCRIPT>
</body>
</html>
Additional query words:
USERAGENT, JSCRIPT, IE3
Keywords : vbObjMdlIE
Version : WINDOWS:3.02
Platform : WINDOWS
Issue type : kbprb