该插件预留写好了调用ajax发送数据,写好了后端程序,再修改成自己的url及参数即可。
function ajax(data) {
var isLoading = true;
var loadNum = 0;
$.ajax({
type: "POST",
data: data,
url: "",
dataType: "json",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
success: function (d) {
console.log("成功", d);
if (d.result == "000") {
successfn(d);
} else {
console.log(d);
if (typeof errorfn === "function") {
errorfn("success", d);
} else {
// $.toast(d.msg);
}
}
},
error: function (e) {
console.log("失败", e);
if (typeof errorfn === "function") {
errorfn("error", e);
} else {
// toast("请求出错!");
console.log(e);
}
},
});
}
