ajax标准请求
ajax
$.ajax({
url:"http://url...",
dataType:"json",
async:true,
data:{"id":"value"},
type:"GET",
beforeSend:function(){
},
success:function(data){
},
complete:function(){
},
error:function(){
}
});
GET
$.get("/", {"key": "val"}, res=>{
alert(res);
});
POST
$.post("/", {"key": "val"}, res=>{
alert(res);
}, "json");
评论 (0)