- href:准备解析的完整的URL,包含协议和主机
'http://user:pass@host.com:8080/pa/a/t/h?query=string#hash'
- protocol:请求协议
'http:'
- slashes:协议要求的斜杠(冒号后)
true 或 false
- host:完整的URL(主机部分,含端口信息)
'host.com'
- auth:url 中的验证信息
'user:pass'
- hostname:域名中的主机名
'host.com'
- port:主机端口号
'8080'
- pathname:url中的路径部分,,在主机名后,查询字符之前,包含第一个斜杠
'/p/a/t/h'
http://127.0.0.1:3000/p/a/t/h?query=string#hash
Url {
protocol: 'http:',
slashes: true,
auth: null,
host: '127.0.0.1:3000',
port: '3000',
hostname: '127.0.0.1',
hash: null,
search: '?query=string',
query: [Object: null prototype] { query: 'string' },
pathname: '/p/a/t/h',
path: '/p/a/t/h?query=string',
href: 'http://127.0.0.1:3000/p/a/t/h?query=string'
}