append()
方法在
URLSearchParams
interface appends a specified key/value pair as a new search parameter.
As shown in the example below, if the same key is appended multiple times it will appear in the parameter string multiple times for each value.
注意: 此特征可用于 Web 工作者 .URLSearchParams.append(name, value)
The name of the parameter to append.
The value of the parameter to append.
Void.
let url = new URL('https://example.com?foo=1&bar=2');
let params = new URLSearchParams(url.search.slice(1));
//Add a second foo parameter.
params.append('foo', 4);
//Query string is now: 'foo=1&bar=2&foo=4'
| 规范 | 状态 | 注释 |
|---|---|---|
|
URL
The definition of 'append()' in that specification. |
实时标准 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
append
|
Chrome 49 | Edge 17 | Firefox 29 | IE 不支持 No | Opera 36 | Safari 10.1 | WebView Android 49 | Chrome Android 49 | Firefox Android 29 | Opera Android 36 | Safari iOS 10.3 | Samsung Internet Android 5.0 |
完整支持
不支持
URL
,
HTMLHyperlinkElementUtils
.
URLSearchParams