BUG: Frame SRC Property Not Updated when Navigate Method InvokedID: Q206652
|
The SRC property on a frame element in an HTML window does not appear to change as that frame is navigated to other pages, unless it is changed directly from script.
To accurately determine the current URL of a document inside a frame, script code should use the window.location.href property of that frame's window object. Cross-frame scripting rules apply.
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.
<HTML><HEAD><TITLE>Frame SRC Problem Replicator</TITLE>
<FRAMESET COLS="50%,*">
<FRAME ID="Blank" SRC="about:blank" SCROLLING=NO NORESIZE>
<FRAME ID="Doc" SRC="DocOne.html" SCROLLING=NO NORESIZE>
</FRAMESET>
</HEAD></HTML>
DOCONE.HTML
<HTML><BODY>
Doc One<P>
<INPUT TYPE="BUTTON" NAME=btnSrc VALUE="Show SRC"><P>
<INPUT TYPE="BUTTON" NAME=btnNav VALUE="Navigate to DocTwo"><P>
<A HREF="DocTwo.html">Show Doc Two</A>
<SCRIPT LANGUAGE="VBScript">
Sub btnSrc_onClick()
msgBox parent.document.all("Doc").src
End Sub
Sub btnNav_onClick()
window.navigate "DocTwo.html"
End Sub
</SCRIPT>
</BODY></HTML>
DOCTWO.HTML
<HTML><BODY>
DocTwo<P>
<INPUT TYPE="BUTTON" NAME=btnSrc VALUE="Show Src"><P>
<INPUT TYPE="BUTTON" NAME=btnNewSrc VALUE="Set SRC to DocThree">
<SCRIPT LANGUAGE="VBScript">
Sub btnSrc_onClick()
msgBox parent.document.all("Doc").src
End Sub
Sub btnNewSrc_onClick()
parent.document.all("Doc").src = "DocThree.html"
End Sub
</SCRIPT>
</BODY></HTML>
DOCTHREE.HTML
<HTML><BODY>
DocThree<P>
<INPUT TYPE="BUTTON" NAME=btnSrc VALUE="Show src">
<SCRIPT LANGUAGE="VBScript">
Sub btnSrc_onClick()
msgBox parent.document.all("Doc").src
End Sub
</SCRIPT>
</BODY></HTML>
The example frameset allows navigation through a series of three pages in the right-hand frame. In any page, the current value of the SRC property on the frame element can be viewed by clicking the Show SRC button.Additional query words:
Keywords : kbDHTML kbIE400bug kbIE401bug kbIE401sp1bug kbIE401sp2bug kbGrpInet kbIE500bug
Version : WINDOWS:4.0,4.01,4.01 SP1,4.01 SP2,5.0
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: June 7, 1999