URL
Represents a parsed URL, providing read-write access to each component (protocol, host, pathname, search params, etc.) per the WHATWG URL Standard.
Module:whatwg.url
Support: Experimental
Since: 1.1.0
Docs: WHATWG Docs
Interface URL
Represents a parsed URL, providing read-write access to each component (protocol, host, pathname, search params, etc.) per the WHATWG URL Standard.
Since: 1.1.0 Docs: WHATWG Docs16 members: 16 undocumented
Constructors
Static Methods
Methods
Properties
The full serialized URL. Setting throws TypeError if the value is not a valid URL.
The full serialized URL. Setting throws TypeError if the value is not a valid URL.
The URL's scheme, including the trailing colon (e.g. `"https:"`).
The URL's scheme, including the trailing colon (e.g. `"https:"`).
The username component of the URL.
The password component of the URL.
The host, including port if non-default (e.g. `"example.com:8080"`).
The password component of the URL.
The path component of the URL, starting with `"/"`.
The query string including the leading `"?"`, or `""` if absent.
A live URLSearchParams object backed by the URL's query string.
The URL fragment including the leading `"#"`, or `""` if absent.
---
Details
constructor(url, base)
new constructor(url: string, base?: string)
new constructor(url: string, base?: string)
| Parameter | Type | Description |
|---|---|---|
url | string | The URL string to parse. |
base (optional) | string | Optional base URL to resolve relative URLs against. |
TypeError--- Ifurlis not a valid URL and cannot be resolved againstbase.
---
Interface URLSearchParams
The query string including the leading "?", or "" if absent.
11 members: 11 undocumented
Constructors
Methods
Properties
The number of key/value pairs contained in this object.
Stringifier
→ string
Iterators
Not documented
---
Details
constructor(init)
new constructor(init?: (sequence> or record or string))
new constructor(init?: (sequence<sequence<string>> or record<string, string> or string))
| Parameter | Type | Description |
|---|---|---|
init (optional) | (sequence<sequence<string>> or record<string, string> or string) |
TypeError--- Ifurlis not a valid URL and cannot be resolved againstbase.
---