01:05:18.512 Uncaught TypeError: Cannot read property 'addData' of null at html/meeting_add.html:228
文件上传提示这个错误,搞了很久也找不到原因,代码如下,谢谢
var path = $("#showImg")[0].src;
alert(path);
var wt=plus.nativeUI.showWaiting();
var flag = false;
var mask = mui.createMask(function(){
return flag;
});
mask.show();//显示遮罩
var task=plus.uploader.createUpload(API.uploadMeetingImg,
{method:"POST"},
function(t,status){ //上传完成
if(status==200){
wt.close();
flag = true;
mask.close();
alert("上传成功:"+t.responseText);
}else{
mui.toast("上传失败:"+status,{ duration:'long', type:'div' });
}
}
);
task.addData("client","file");
task.addData("uid",getUid());
task.addFile(path,{key:'file'});
task.start();
0 个回复