87,997
社区成员




//jQuery的post方法
function scPostExt(url, data, callback, async, type, dataType) {
if (!type) {
type = "post";
}
if (!dataType) {
dataType = "json";
}
if (!async || async == null || typeof (async) == "undefined") {
async = true;
}
$.ajax({
url: globalData.apiUrl + url,
type: type,
dataType: dataType,
data: data,
async: async,
headers: {
'token': '3333333'
},
success: callback,
error: function (xhr, textStatus, errorThrown) {
console.log("进入error---");
console.log("状态码:" + xhr.status);
console.log("状态:" + xhr.readyState); //当前状态,0-未初始化,1-正在载入,2-已经载入,3-数据进行交互,4-完成。
console.log("错误信息:" + xhr.statusText);
console.log("返回响应信息:" + xhr.responseText); //这里是详细的信息
console.log("请求状态:" + textStatus);
console.log(errorThrown);
console.log("请求失败");
}
});
}