FormData.values()
FormData.values()
方法返回一个允许遍历该对象中所有值的 迭代器
。这些值是 USVString
或是Blob
对象。
注意: 此方法在 Web Workers 中可用
语法
formData.values();
返回值
返回一个迭代器
.
示例
//创建一个FormData测试对象
var formData = new FormData();
formData.append('key1', 'value1');
formData.append('key2', 'value2');
//显示值
for (var value of formData.values()) {
console.log(value);
}
结果为:
value1 value2
规范
Specification | Status | Comment |
---|---|---|
XMLHttpRequest values() (as iterator<>) |
Living Standard | Initial definition |
浏览器兼容性
We're converting our compatibility data into a machine-readable JSON format.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
Find out how you can help! (en-US)
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 50.0 | 44 (44) | ? | ? | ? |
Available in web workers | 50.0 |
Feature | Android | Android Webview | Firefox Mobile (Gecko) | Firefox OS (Gecko) | IE Mobile | Opera Mobile | Safari Mobile | Chrome for Andorid |
---|---|---|---|---|---|---|---|---|
Basic support | 未实现 | 50.0 | 44.0 (44) | (Yes) | ? | ? | ? | 50.0 |
Available in web workers | 未实现 | 50.0 | 50.0 |