用:
var fd = new FormData();
fd.append('id', 10);
fd.append('file', document.getElementById('file').files[0]);
的方式上传图片非常方便,可是fd还有一个get方法,这个方法在mac os中的chrome我测试通过了的可以获取到append追加进去的值,但在windows的chrome浏览器中却不行,见下图:
用:
var fd = new FormData();
fd.append('id', 10);
fd.append('file', document.getElementById('file').files[0]);
的方式上传图片非常方便,可是fd还有一个get方法,这个方法在mac os中的chrome我测试通过了的可以获取到append追加进去的值,但在windows的chrome浏览器中却不行,见下图: