PRB: Using Brackets [] to Index an Array of Objects Causes ErrorID: Q190243
|
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:
This error should occur only if all three of the following conditions are met:Microsoft JScript runtime error
[Line: 12] 'parent.frames[...].location' is not an object
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.
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)"
************************************************************************
************************************************************************
<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
Last Reviewed: May 3, 1999