Compartir a través de


window HTML Object

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

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.

external

Object

Read/write

Sets and retrieves properties and other features made available in the object model provided by the browser's hosting application.

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.

scrollTo

window .scrollTo (x-coord,y-coord)

Redisplays the document.with the provided coordinates being the upper left corner of the display. There is no returned value.

x-coord is location of the pixel on the horizontal axis of the document that is to be in the upper left of the display.

y-coord is location of the pixel on the virtical axis of the document that is to be in the upper left of the display.

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

Windows Mobile Pocket PC 2000 and later, Smartphone 2002 and later

See Also

Other Resources

Internet Explorer Mobile HTML Scripting Objects