Retrieves the
window object of the specified
frame or
iframe.
dhtml语法
html | n/a |
---|
scripting | [ owindow = ] document.all.object.contentwindow |
---|
dhtml可能的值
oWindow |
Object that
receives the
window object. |
The property is read-only.
The property has no default value.
Remarks
This property is useful if you do not know the id of the frame or iframe you are accessing through a collection.
DHTML代码范例
The following example shows how to use the contentWindow property to change the URL of window objects contained inside several iframe objects.
<html>
<head>
<SCRIPT>
function fnNavigate()
{
for(i=0;i<document.all.length;i++)
{
if(document.all(i).tagName=="IFRAME")
{
document.all(i).contentWindow.location = "http://www.msn.com";
}
}
}
</SCRIPT>
</HEAD>
<BODY>
<BUTTON onclick="fnNavigate();">Navigate Frames</BUTTON>
<P/>
<IFRAME SRC="/hbcms/php/r.php?url=http%3A%2F%2Fwww.microsoft.com" STYLE="width:100%;height:150px;">
</IFRAME>
<P/>
<IFRAME SRC="/hbcms/php/r.php?url=http%3A%2F%2Fwww.microsoft.com" STYLE="width:100%;height:150px;">
</IFRAME>
<P/>
<IFRAME SRC="/hbcms/php/r.php?url=http%3A%2F%2Fwww.microsoft.com" STYLE="width:100%;height:150px;"/>
</IFRAME>
</BODY>
</HTML>
This feature requires Microsoft® Internet Explorer 5.5 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

是否符合公共标准
There is no public standard that applies to this property.
Applies To
更多语法参考
frameElement