Share via


location HTML Object

The location object contains information about the current URL.

Properties

Property Data type Access Description
hash String Read/write
Sets or retrieves the part of URL starting from the pound sign (#) inclusive and beyond. If you change the hash, the browser scrolls up or down to the appropriate bookmark but the hash property does not reflect the change.
host String Read/write Sets or retrieves the hostname of the page location.

In Pocket Internet Explorer, this property does not return the port number.

hostname String Read/write Sets or retrieves the host name part of the page location.
href String Read/write Sets or retrieves the entire URL as a string.
pathname String Read/write Sets or retrieves the file name or path of the page location.
port String Read/write Sets or retrieves the port number associated with the URL.
search String Read/write Sets or retrieves the search (query) string portion of the URL. This includes the leading question mark.

Methods

Method Syntax Description
reload location.reload Reloads the current page.

This method does not take the ReloadSource parameter, which specifies whether to check reload the page from the browser's cache or to reload it from the server. Pocket Internet Explorer always checks against the server if the user is online.

replace location.replace(URL) Replaces the current document by loading the document at the specified URL (in the required URL parameter).

Requirements

Smartphone: Windows Mobile 2002 and later
OS Versions: Windows CE 3.0 and later

Last updated on Friday, April 22, 2005

© 2005 Microsoft Corporation. All rights reserved.

Send feedback on this topic to the authors.