Article ID: 191184
Article Last Modified on 5/12/2003
<SCRIPT LANGUAGE=VBSCRIPT> Sub Window_OnLoad() Dim f For Each f In Document.Frames MsgBox f.location.href Next End Sub </SCRIPT>You can change this code to use the regular for loop syntax as follows:
<SCRIPT LANGUAGE=VBSCRIPT> Sub Window_OnLoad() Dim i For i = 0 to document.frames.length - 1 MsgBox frames(i).location.href Next End Sub </SCRIPT>
<HTML> <HEAD> <SCRIPT LANGUAGE=VBSCRIPT> Sub Window_OnLoad() Dim f For Each f In Document.Frames MsgBox f.location.href Next End Sub </SCRIPT> </HEAD> <FRAMESET rows="50%,*"> <FRAME SRC="frame1.htm"></FRAME> <FRAME SRC="frame2.htm"></FRAME> </FRAMESET> </HTML>
<HTML>
<HEAD>
</HEAD>
<BODY>
FRAME 1
</BODY>
</HTML>
<HTML>
<HEAD>
</HEAD>
<BODY>
FRAME 2
</BODY>
</HTML>
Keywords: kbbug kbscript kbieobj kbhtml kbpending KB191184