entries()
方法在
URLSearchParams
interface returns an
iterator
allowing iteration through all key/value pairs contained in this object. The key and value of each pair are
USVString
对象。
searchParams.entries();
None.
返回
iterator
.
// Create a test URLSearchParams object
var searchParams = new URLSearchParams("key1=value1&key2=value2");
// Display the key/value pairs
for(var pair of searchParams.entries()) {
console.log(pair[0]+ ', '+ pair[1]);
}
The result is:
key1, value1 key2, value2
| 规范 | 状态 | 注释 |
|---|---|---|
|
URL
The definition of 'entries() (see "iterable")' in that specification. |
实时标准 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
entries
|
Chrome 49 | Edge 17 | Firefox 44 | IE 不支持 No | Opera 36 | Safari Yes | WebView Android 49 | Chrome Android 49 | Firefox Android 44 | Opera Android 36 | Safari iOS Yes | Samsung Internet Android 5.0 |
完整支持
不支持
URL
接口。
URLSearchParams