This topic has not yet been rated - Rate this topic

Location Prototype

Defines the properties and methods inherited by objects in the Location prototype chain.

Syntax

HTML N/A
Scripting Location.prototype

Members Table

The following table lists the members exposed by the Location Constructor object.

Attributes/Properties

Property Description
hash Sets or retrieves the subsection of the href property that follows the number sign (#).
host Sets or retrieves the hostname and port number of the location or URL.
hostname Sets or retrieves the host name part of the location or URL.
href Sets or retrieves the entire URL as a string.
pathname Sets or retrieves the file name or path specified by the object.
port Sets or retrieves the port number associated with a URL.
protocol Sets or retrieves the protocol portion of a URL.
search Sets or retrieves the substring of the href property that follows the question mark.

Methods

Method Description
assign Loads a new HTML document.
reload Reloads the current document.
replace

Replaces the current document by loading another document at the specified URL.

Remarks

This prototype does not derive from any objects.

For more information on this and other DOM Prototypes see Document Object Model Prototypes, Part 1: Introduction.

 New for Windows Internet Explorer 9 Internet Explorer 9. In IE9 Standards mode, the getPrototypeOf method returns null for the Location constructor. (The location object does not inherit from the Location prototype in IE9 mode.)

Applies To

location

See Also

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ