用jQuery写一个完整的ajax请求
$.ajax({
type:'post', //get 这里写请求方式
url:'', //这里写请求地址
dataType:"json", //这里写请求返回的格式
async:true, //请求是否异步,默认异步
data:{
}, // 这里写请求的参数
success:function (res) { //请求成功打印一下,看看
console.log(res)
},
error : function(e){ //请求失败,查看错误信息
console.log(e.status);
console.log(e.responseText);
}
})