Share via


window HTML Object

Send Feedback

The window object represents a window in the browser.

Properties

Property Data type Access Description
document Object Read-only Retrieves the HTML document in a given popup window.
Note   Supported only for devices running Smartphone 2002 and Pocket PC 2002 software or later.
history Object Read-only Contains information about the URLs visited by the client.
length Long Read-only Retrieves the number of frames in the window.
location Object Read-only Returns an object that represents the location information of the current document.
Note   Supported only for devices running Smartphone 2002 and Pocket PC 2002 software or later.
name String Read/write Sets or retrieves the name of the object.
Note   Supported only for devices running Smartphone 2002 and Pocket PC 2002 software or later.
navigator Object Read-only Contains information about the Web browser.
parent Object Read-only Retrieves the parent of the window in the object hierarchy.
screen Object Read-only Returns a window object, which enables you to manipulate forms according to their placement on the screen.
Note   Supported only for devices running Smartphone 2002 and Pocket PC 2002 software or later.
self Object Read-only Retrieves a reference to the current window or frame.
top Object Read-only Retrieves the topmost ancestor window, which is its own parent.
window Object Read-only A handle of the window-specific data and that can be any value.
Note   Supported only for devices running Smartphone 2002 and Pocket PC 2002 software or later.

Events

Event Description
onload Occurs immediately after the window is loaded.
Note   Supported only for devices running Smartphone 2002 and Pocket PC 2002 software or later.
onunload Occurs immediately before the current window is unloaded.
Note   Supported only for devices running Smartphone 2002 and Pocket PC 2002 software or later.

Methods

Method Syntax Description
alert window.alert(Message) Displays a dialog box containing the contents of the required Message parameter.
blur window.blur Causes the browser window (Internet Explorer Mobile) to lose focus, switching you to the previous application.
clearTimeout window.clearTimeout(TimerID) Cancels a time-out that was set with the setTimeout method. The required TimeoutID parameter should be set to the time-out ID that is returned from setTimeout.
close window.close Closes the current browser window.
confirm Choice=window.confirm(Message) Displays a confirmation dialog box that contains the message contained in the required Message parameter, in addition to OK and Cancel buttons. The method returns true if the user clicks OK or false if the user clicks Cancel.
focus window.focus Sets focus to the window.
navigate window.navigate(URL) Navigates the browser to the URL specified by the required URL parameter.
prompt TextData=window.prompt(Message, [DefaultValue]) Displays a dialog box prompting the user with a message contained in the required Message parameter and a text field. The text entered in the field is returned in TextData. DefaultValue can contain an optional default value in the text box.
scroll   Not supported in Internet Explorer Mobile.
setTimeout TimerID=window.xsetTimeout(Code, MilliSeconds) Executed code specified by the Code parameter after the interval expressed in milliseconds in the Milliseconds parameter have passed. This method returns TimerID (which is used with clearTimeout). Code must be a string and cannot be a function pointer.

Collections

The following collections are supported for the window object:

Requirements

Pocket PC: Pocket PC 2000 and later
Smartphone: Smartphone 2002 and later
OS Versions: Windows CE 3.0 and later

See Also

Internet Explorer Mobile HTML Objects

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.