The URL interface represents an object providing static methods used for creating, parsing, and manipulating URLs.
Properties #
The hash property of the URL interface is a string that starts with a #
and is followed by the fragment identifier of the URL.
It returns an empty string if the URL does not contain a fragment identifier.
The host
property of the URL interface is a string that includes the URL.hostname
and the URL.port
if one is specified in the URL includes by including a :
followed by the port number.
The hostname
property of the URL interface is a string that represents the fully qualified domain name of the URL.
The origin
property of the URL interface is a string that represents the origin of the URL, that is the URL.protocol
, URL.host
, and URL.port
.
The password
property of the URL interface is a string that represents the password specified in the URL.
The pathname
property of the URL interface is a string that represents the path of the URL.
The port
property of the URL interface is a string that represents the port of the URL if an explicit port has been specified in the URL.
The protocol
property of the URL interface is a string that represents the protocol scheme of the URL and includes a trailing :
.
The search
property of the URL interface is a string that represents the search string, or the query string, of the URL.
This includes the ?
character and the but excludes identifiers within the represented resource such as the URL.hash
. More granular control can be found using URL.searchParams
property.
#searchParams: URLSearchParams
The searchParams
property of the URL interface is a URL.URLSearchParams
object that represents the search parameters of the URL.