ajax返回数据为json才无法无法执行success
附上代码:
var file = new FormData($("#uploadForm")[0]);
if (“undefined” != typeof (file) && file != null && file != “”) {
$.ajax({
url: “/”,
type: ‘POST’,
data: file,
async: false,
dataType: ‘json’,
cache: false,
contentType: false, //不设置内容类型
processData: false, //不处理数据
success: function (data) {
var num=data.return_code;
if (num== 0) {
layer.msg(“导入成功”);
/* window.local.href="/";*/
$("#uploadForm").attr(“action”,"/");