ajax请求模板

$.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("");
        }
    });
原文地址:https://www.cnblogs.com/cxhzy/p/12789816.html