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");
Last modification:December 7th, 2021 at 04:16 pm
如果觉得我的文章对你有用,请随意赞赏