ajax标准请求

jupiter
2021-01-24 / 0 评论 / 613 阅读 / 正在检测是否收录...
温馨提示:
本文最后更新于2021年12月07日,已超过870天没有更新,若内容或图片失效,请留言反馈。

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)

打卡
取消