ms.location

The location object contains information about the current URL.


Variables

Value Description
hash It sets or returns the anchor part (#) of a URL.
host It sets or returns the host name and port number of a URL.
hostname It sets or returns the host name of a URL.
href It sets or returns the entire URL.
origin It returns the protocol, host name and port number of a URL.
pathname It sets or returns the path name of a URL.
port It sets or returns the port number of a URL.
protocol It sets or returns the protocol of a URL.
search It sets or returns the query string part of a URL.

Methods

Value Description
assign This method loads a new document.
reload The method reloads the current document.
replace It replaces the current document with a new one.
absUrl It returns the full URL representation with all segments encoded according to rules specified in RFC 3986.
path The method changes path when called with parameter.