Location

The location (URL) of the object it is linked to. Changes done on it are reflected on the object it relates to. Accessible via globalThis.location.

class Location {
constructor();
readonly ancestorOrigins: DOMStringList;
hash: string;
host: string;
hostname: string;
href: string;
readonly origin: string;
pathname: string;
port: string;
protocol: string;
search: string;
 
assign(url: string): void;
reload(): void;
reload(forcedReload: boolean): void;
replace(url: string): void;
toString(): string;
}

§Constructors

§
new Location()
[src]

§Properties

§
ancestorOrigins: DOMStringList
[src]

Returns a DOMStringList object listing the origins of the ancestor browsing contexts, from the parent browsing context to the top-level browsing context.

Always empty in Deno.

§
hash: string
[src]

Returns the Location object's URL's fragment (includes leading "#" if non-empty).

Cannot be set in Deno.

§
host: string
[src]

Returns the Location object's URL's host and port (if different from the default port for the scheme).

Cannot be set in Deno.

§
hostname: string
[src]

Returns the Location object's URL's host.

Cannot be set in Deno.

§
href: string
[src]

Returns the Location object's URL.

Cannot be set in Deno.

§
origin: string
[src]

Returns the Location object's URL's origin.

§
pathname: string
[src]

Returns the Location object's URL's path.

Cannot be set in Deno.

§
port: string
[src]

Returns the Location object's URL's port.

Cannot be set in Deno.

§
protocol: string
[src]

Returns the Location object's URL's scheme.

Cannot be set in Deno.

§Methods

§
assign(url: string): void
[src]

Navigates to the given URL.

Cannot be set in Deno.

§
reload(): void
[src]

Reloads the current page.

Disabled in Deno.

reload(forcedReload: boolean): void deprecated
[src]
@deprecated
§
replace(url: string): void
[src]

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

Disabled in Deno.

§
toString(): string
[src]