? 之后,形如 k1=v1&k2=v2,片段标识在 # 之后。& 切分为键值对,再按首个 = 分割,并对键值做百分号解码。?tag=a&tag=b),应解析为数组。URLSearchParams 完成解析与序列化。Parse a URL's query string into keys and values, and edit parameters to rebuild the URL.
| Item | Formula / Note | Source / Standard |
|---|---|---|
| Query syntax | starts with ?, key=value joined by & | RFC 3986 Section 3.4 |
| Encoding | encode keys and values; plus may denote space | RFC 3986 / HTML forms |
| Ordering | the spec defines no ordering semantics | RFC 3986 |