Share via


document HTML Object

Send Feedback

The document object represents the HTML document in a given browser window or frame. It corresponds to the BODY HTML element.

Properties

Property Data type Access Description
alinkColor Variant Read/write
Note   Read-only for devices running PocketPC 2000 software.
Contains the active link color in the specified document.

The color values returned by Internet Explorer Mobile are not prefixed with the number sign character (#).

Note   This property always returns 000000 for Pocket PC 2000.
bgColor Variant Read/write Sets or retrieves the background color of the specified document.

The color values returned by Internet Explorer Mobile are not prefixed with the number sign character (#).

cookie String Read/write Sets or retrieves the string value of a cookie.

Specifies or receives the name=value pairs, plus any of the following values:

expires=date;

Setting no expiration date on a cookie causes it to expire when the browser closes. If you set an expiration date in the future, the cookie is saved across browser sessions. If you set an expiration date in the past, the cookie is deleted. Use GMT format to specify the date.

domain=domainname;

Setting the domain of the cookie allows pages on a domain made up of more than one server to share cookie information.

path=path;

Setting a path for the cookie allows the current document to share cookie information with other pages within the same domain — that is, if the path is set to /thispathname, all pages in /thispathname and in its subfolders can access the same cookie information.

secure;

Setting a cookie as secure means the stored cookie information can be accessed only from a secure environment.

domain String Read/write
Note   Read-only for devices running Smartphone 2002 and Pocket PC 2000 software.
Contains the domain that the document is on, which is initially set to the host that the document is on (such as www.adatum.com).
fgColor Variant Read/write Sets or retrieves the foreground (text) color of the document.

The color values returned by Internet Explorer Mobile are not prefixed with the number sign character (#).

lastModified String Read-only Contains the time and date the document was last modified.
linkColor Variant Read/write Sets or retrieves the color of the links in the document.

The color values returned by Internet Explorer Mobile are not prefixed with the number sign character (#).

location String Read/write Sets or retrieves the current URL of the document. It is also an object that represents information about the current document.
referrer String Read-only Contains the URL of the document where the current document was linked. In Internet Explorer Mobile, this property always returns an empty string.
Note   Not implemented in Smartphone 2002 and Pocket PC 2002.
title String Read-only Contains the document title.
URL String Read-only Contains the URL for the current document.
vlinkColor Variant Read/write
Note   Read-only for devices running Smartphone 2002 and Pocket PC 2000 software.
Contains the color of visited links in a specified document.

The color values returned by Internet Explorer Mobile are not prefixed with the number sign character (#).

Note   This property always returns 000000 for Smartphone 2002 and Pocket PC 2000.

Events

Event Description
onload Occurs immediately after the page is loaded.
onunload Occurs immediately before the current page is unloaded — for example, when the user navigates away from the page or refreshes the page.

Methods

Method Syntax Description
clear document.clear Clears the contents of a selection.
Note   Supported only for devices running Smartphone 2002 and Pocket PC 2002 software or later.
close document.close Closes the stream and forces the data written to the document to be displayed.
open document.open(MIMEtype, replace) Opens a stream to a new document so that subsequent calls to document.write can append data to the document.

MIMEtype is an optional String argument that specifies the type of data to write and display in the document.

replace is an optional Variant argument that indicates whether calls to document.write replace existing content in the document.

Note   Supported only for devices running Smartphone 2002 and Pocket PC 2002 software or later.
write document.write(Text) Writes a Text string (which can contain HTML) to the document.
writeln document.writeln(Text) Writes a Text string (which can contain HTML) followed by a carriage return to the document.

Carriage returns are ignored in HTML unless they are in preformatted text.

Collections

The following collections are supported for the document 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.