Location

Location for document.

#include <Location.idl>

Public Functions

Name
voidassign(USVString url)
Navigates to the given URL.
voidreplace(USVString url)
Removes the current page from the session history and navigates to the given URL.
voidreload(optional Bool forceReload)
Reloads the current page.

Public Attributes

Name
attribute USVStringhref
Whole url of the document.
readonly attribute USVStringorigin
URL’s origin.
attribute USVStringprotocol
URL’s protocol.
attribute USVStringhost
URL’s host and port (if different from the default port for the scheme)
attribute USVStringhostname
URL’s host.
attribute USVStringport
URL’s port.
attribute USVStringpathname
URL’s path.
attribute USVStringsearch
URL’s query (includes leading “?” if non-empty)
attribute USVStringhash
URL’s fragment (includes leading “#” if non-empty)
readonly attribute sequence< USVString >ancestorOrigins

Public Functions Documentation

function assign

void assign(
    USVString url
)

Navigates to the given URL.

function replace

void replace(
    USVString url
)

Removes the current page from the session history and navigates to the given URL.

function reload

void reload(
    optional Bool forceReload
)

Reloads the current page.

Public Attributes Documentation

variable href

attribute USVString href;

Whole url of the document.

variable origin

readonly attribute USVString origin;

URL’s origin.

variable protocol

attribute USVString protocol;

URL’s protocol.

variable host

attribute USVString host;

URL’s host and port (if different from the default port for the scheme)

variable hostname

attribute USVString hostname;

URL’s host.

variable port

attribute USVString port;

URL’s port.

variable pathname

attribute USVString pathname;

URL’s path.

attribute USVString search;

URL’s query (includes leading “?” if non-empty)

variable hash

attribute USVString hash;

URL’s fragment (includes leading “#” if non-empty)

variable ancestorOrigins

readonly attribute sequence< USVString > ancestorOrigins;