S 回调函数,传参的办法。function uploadFile(t) { var fd = new FormData(); fd.append("_netLogo", document.getElementById('_netLogo').files[0]); var xhr = new XMLHttpRequest();// 原来 xhr.upload.addEventListener("progress", uploadProgress, false); xhr.upload.addEventListener("progress", function () { uploadProgress(event,t) }, false); xhr.addEventListener("load", uploadComplete, false); xhr.addEventListener("error", uploadFailed, false); xhr.addEventListener("abort", uploadCanceled, false); xhr.open("POST", "/User/WNetEdit2_test"); xhr.send(fd); }function uploadProgress(evt, t) { $(t).parent().find("._ProgressNum").remove(); }上面代码中为什么调动不了 uploadProgress(evt, t) 方法啊,我想把t传过去,麻烦大神解释一下,或者其他方案也行
添加回答
举报
0/150
提交
取消