- http://user:pass@host.com:8080/p/a/t/h?query=string#hash
- ┌─────────────────────────────────────────────────────────────────────────────┐
- │ href │
- ├──────────┬┬───────────┬─────────────────┬───────────────────────────┬───────┤
- │ protocol ││ auth │ host │ path │ hash │
- │ ││ ├──────────┬──────┼──────────┬────────────────┤ │
- │ ││ │ hostname │ port │ pathname │ search │ │
- │ ││ │ │ │ ├─┬──────────────┤ │
- │ ││ │ │ │ │ │ query │ │
- " http: // user:pass @ host.com : 8080 /p/a/t/h ? query=string #hash "
- │ ││ │ │ │ │ │ │ │
- └──────────┴┴───────────┴──────────┴──────┴──────────┴─┴──────────────┴───────┘
来源: