ajax标准请求

jupiter
2021-01-24 / 0 评论 / 606 阅读 / 正在检测是否收录...

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

评论 (0)

打卡
取消