如果我想把dojo换成jquery用来上传文件,下面的这段代码应该怎么改?
functionuploadFile(fileType,formId,method,callback){dojo.require("dojo.io.iframe");va...
function uploadFile(fileType, formId, method, callback) {
dojo.require("dojo.io.iframe");
var upload_url = "AjaxService?action=" + method + "&fileType=" + fileType;
dojo.io.iframe.send({
form: dojo.byId(formId),
url: upload_url,
method: 'POST',
contentType: "multipart/form-data",
handleAs: "text/plain",
handle: function(response, ioArgs){
if(response instanceof Error){
alert("Failed to upload file, please try later.");
}else{
eval(callback+'(response)');
}
}
});
}
求教。
还有给我解释一下这段代码的含义。谢谢。 展开
dojo.require("dojo.io.iframe");
var upload_url = "AjaxService?action=" + method + "&fileType=" + fileType;
dojo.io.iframe.send({
form: dojo.byId(formId),
url: upload_url,
method: 'POST',
contentType: "multipart/form-data",
handleAs: "text/plain",
handle: function(response, ioArgs){
if(response instanceof Error){
alert("Failed to upload file, please try later.");
}else{
eval(callback+'(response)');
}
}
});
}
求教。
还有给我解释一下这段代码的含义。谢谢。 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询