在未实现接口FormData的对象上调用了“ append”
我正在尝试使用jquery和ajax上传图像。但是奇怪的事情在这里发生了。在控制台中记录其显示 TypeError:在未实现接口FormData的对象上调用了“ append”。 请告诉我我在这里做错了什么? JS脚本 var prosrc=$("#pro_pix img").last().attr("src"); $("#logoform").on('change',function(event){ var postData = new FormData(this); $("#pro_pix img").last().hide(); $("#pro_pix img").first().show(); event.preventDefault(); $.ajax( { url : "/function/pro_pic_upload.php", type: "POST", data : postData, success:function(data, textStatus, jqXHR) { $("#pro_pix img").last().show(); $("#pro_pix img").first().hide(); $("#pro_pix h6").text(data); }, error: function(jqXHR, textStatus, errorThrown) { //if fails } }); }); …