You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/api/url.md
+33-33Lines changed: 33 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,21 +16,21 @@ When parsed, a URL object is returned containing properties for each of these
16
16
components.
17
17
18
18
The following details each of the components of a parsed URL. The example
19
-
`'http://user:[email protected]:8080/p/a/t/h?query=string#hash'` is used to
19
+
`'http://user:pass@sub.host.com:8080/p/a/t/h?query=string#hash'` is used to
(all spaces in the "" line should be ignored -- they are purely for formatting)
35
35
```
36
36
@@ -56,21 +56,21 @@ For example: `'#hash'`
56
56
The `host` property is the full lower-cased host portion of the URL, including
57
57
the `port` if specified.
58
58
59
-
For example: `'host.com:8080'`
59
+
For example: `'sub.host.com:8080'`
60
60
61
61
### urlObject.hostname
62
62
63
63
The `hostname` property is the lower-cased host name portion of the `host`
64
64
component *without* the `port` included.
65
65
66
-
For example: `'host.com'`
66
+
For example: `'sub.host.com'`
67
67
68
68
### urlObject.href
69
69
70
70
The `href` property is the full URL string that was parsed with both the
71
71
`protocol` and `host` components converted to lower-case.
72
72
73
-
For example: `'http://user:[email protected]:8080/p/a/t/h?query=string#hash'`
73
+
For example: `'http://user:pass@sub.host.com:8080/p/a/t/h?query=string#hash'`
`delete myURL.pathname`, etc) has no effect but will still return `true`.
325
325
326
326
A comparison between this API and `url.parse()` is given below. Above the URL
327
-
`'http://user:[email protected]:8080/p/a/t/h?query=string#hash'`, properties of an
327
+
`'http://user:pass@sub.host.com:8080/p/a/t/h?query=string#hash'`, properties of an
328
328
object returned by `url.parse()` are shown. Below it are properties of a WHATWG
329
329
`URL` object.
330
330
331
331
*Note*: WHATWG URL's `origin` property includes `protocol` and `host`, but not
0 commit comments