腾讯云优惠券
呆错后台管理框架(daicuo.ajax.get)请求实例
人气:107 更新:2022-08-23

AJAX的GET请求调用实例

$(document).on("click", '[data-toggle="referer"]', function() {
    daicuo.ajax.get($(this).data('url'), function($result, $xhr, $status){
        if($result.code){
            //后端响应成功
            jQuery.each($result.data,function(index, value){
                alert(value);
            });
        }else{
            //后端响应失败
            daicuo.bootstrap.dialog($result.msg);
        }
    },function($xhr, $status){
        //AJAX请求失败
        daicuo.bootstrap.dialog($xhr);
    });
});