标签:style http io color ar os sp for on
JS 回调函数,传参的办法。
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();
}
JS XMLHttpRequest.upload.addEventListener 传参,回调
标签:style http io color ar os sp for on
原文地址:http://www.cnblogs.com/90nice/p/4080333.html