$.jsonp
廖招
2023-12-01
$.jsonp({
url: "http://localhost:8080/fileapp/fileId.action",
callbackParameter: "callback",
success: function (data) {
alert("success-[data]:"+JSON.stringify(data));
//fileDataId = data;
if(data != null){
$.jsonp({
url: "http://localhost:8080/fileapp/fileupload.action?fileOperator=up&FILE_ID="+data+"&EXT=EXT",
data: uploader.files,
method : "post",
enctype: "multipart/form-data",
type : "file",
callbackParameter: "callback",
success: function (data1) {
//var jqueryObj1 = $(data1);
//var message1 = jqueryObj1.children();
//var text1 = message1.text();
//alert("success-[data-text1-h]:"+text1);
alert("success-[data1-h]:"+JSON.stringify(data1));
},
error: function (data2) {
//var jqueryObj2 = $(data2);
//var message2 = jqueryObj2.children();
//var text2 = message2.text();
//alert("error-[data-text2-h]:"+text2);
alert("error-[data2-h]:"+JSON.stringify(data2));
}
});
}else{
alert("文件ID生成失败!");
}
},
error: function (data) {
alert("error-[data]:"+JSON.stringify(data));
}
});