FormData.entries()
method returns an
iterator
allowing to go through all key/value pairs contained in this object. The key of each pair is a
USVString
object; the value either a
USVString
,或
Blob
.
注意 : This method is available in Web 工作者 .
formData.entries();
返回
iterator
.
// Create a test FormData object
var formData = new FormData();
formData.append('key1', 'value1');
formData.append('key2', 'value2');
// Display the key/value pairs
for(var pair of formData.entries()) {
console.log(pair[0]+ ', '+ pair[1]);
}
The result is:
key1, value1 key2, value2
| 规范 | 状态 | 注释 |
|---|---|---|
|
XMLHttpRequest
The definition of 'entries() (as iterator<>)' in that specification. |
实时标准 | 初始定义 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
entries
|
Chrome 50 | Edge 18 | Firefox 44 | IE No | Opera 37 | Safari 11 | WebView Android 50 | Chrome Android 50 | Firefox Android 44 | Opera Android 37 | Safari iOS 11 | Samsung Internet Android 5.0 |
完整支持
不支持
FormData