$.ajax({
    url:"test.json",
    type: "GET",
    data: {username:$("#username").val()},
    dataType: "json",
    beforSend:function(){ 
         // 禁用按钮防止重复提交
        $("#submit").attr({ disabled: "disabled" });
    }, 
    complete:function(msg){ 
        //请求完成后调用的回调函数(请求成功或失败时均调用)
    } , 
    error:function(msg){ 
        //请求失败时被调用的函数 
    } , 
    Sucess:function(msg){ 
        //请求成功后调用的回调函数 
    } 
});

相关文章:

  • 2021-04-28
  • 2021-06-02
  • 2022-12-23
  • 2022-02-26
  • 2021-09-13
  • 2022-02-11
  • 2021-12-24
  • 2021-06-05
猜你喜欢
  • 2022-12-23
  • 2022-02-16
  • 2021-11-16
  • 2022-12-23
  • 2022-12-23
  • 2021-09-09
相关资源
相似解决方案