property |
description |
href
|
String that containing the whole URL.
// goto to home link
location.href="http://socode4.com/"
|
protocol
|
The protocol scheme of the URL, including the final ':'.
|
host
|
The host, that is the hostname, a ':', and the port of the URL.
|
port
|
The port number of the URL.
|
pathname
|
String that containing an initial '/' followed by the path of the URL.
|
search
|
String that contains a '?' followed by the parameters or "querystring" of the URL. Modern browsers provide URLSearchParams and URL.searchParams to make it easy to parse out the parameters from the querystring.
|
hash
|
String that contains containing a '#' followed by the fragment identifier of the URL.
|
username
|
The username specified before the domain name.
|
password
|
The password specified before the domain name.
|