Share via


location HTML Object

Send Feedback

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 Internet Explorer Mobile, 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. Internet Explorer Mobile 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

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.