Home | Top | Free Ajax Editor | JavaScript Editor JavaScript EditorGet Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.


contentWindow Property

Retrieves the window object of the specified frame or iframe .

Syntax

HTML Scripting
N/A
[ oWindow = ] document.all.object . contentWindow

Possible Values

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.

Example

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="http://www.microsoft.com" STYLE="width:100%;height:150px;"> </IFRAME> </P>
<IFRAME SRC="http://www.microsoft.com" STYLE="width:100%;height:150px;"> </IFRAME>
<IFRAME SRC="http://www.microsoft.com" STYLE="width:100%;height:150px;"/> </IFRAME>
</BODY>
</HTML>

Standards Information

There is no public standard that applies to this property.

Applies To

[ Object Name ] Platform Version
Win32:
Windows CE:
 
FRAME , IFRAME
Home | Top | Free Ajax Editor | JavaScript Editor JavaScript EditorGet Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.