公用的ajax模板

丹柯yx

关注

阅读 94

2022-07-14

//一个公用的ajax模板

function loadKind() {

let sendData = {};

$.ajax({

type: 'get',

url : '/api/species',

//url: '/api/one/new/list?p=1',

data: sendData,

dataType: 'json',

success: function (data) {

if (data) {

//请求成功

} else {

alert(data.msg);

}

},

error: function () {

//alert("");

}

});

}//一个公用的ajax模板

function loadKind() {

let sendData = {};

$.ajax({

type: 'get',

url : '/api/species',

//url: '/api/one/new/list?p=1',

data: sendData,

dataType: 'json',

success: function (data) {

if (data) {

//请求成功

} else {

alert(data.msg);

}

},

error: function () {

//alert("");

}

});

}

精彩评论(0)

0 0 举报