为什么FormData为空?

时间:2015-12-08 11:20:30

标签: javascript jquery upload form-data

我已关注this guide on MDN

var formData = new FormData();    
formData.append("username", "Groucho");
formData.append("accountnum", 123456);
console.log(formData);

为什么formData为空?

1 个答案:

答案 0 :(得分:10)

他们可以访问FormData

var formData = new FormData();

formData.append("username", "Groucho");
formData.append("accountnum", 123456);

console.log(formData.get("username"));
console.log(formData.get("accountnum"));