Jquery ajax请求格式

$(function(){
         $.ajax({
                    type: 'post',
                    url: 'aaa/bbb.do',
                    contentType: 'application/json;charset=utf-8',
                    data: '{"name": "uname", "age": 18}',
                    success: function (data) { //返回json结果
                        alert(data);
                    alert(data.name);
                    }
           });   
});

 

posted @ 2019-01-11 17:39  new_boys  阅读(1260)  评论(0)    收藏  举报