JQuery Ajax 请求格式

Ajax 请求格式

function clickFun() {
    $.ajax({
        url: "http://localhost:8088/user/get-level-users?level=1",
        type: "GET",
        headers: {
            "X-Requested-With": XMLHttpRequest
        },
        success:function(result){
            console.log(result)
        },
        error:function(error){
            console.log("error", error)
        }
    });
}
function postMethodFun(){
    $.ajax({
      url: Feng.ctxPath + "/authentication/approval",
       type: "POST",
       data: JSON.stringify(data),
       contentType:"application/json",
       dataType : "json",
       success:function(result){
           console.log(result)
       },
       error:function(error){
           console.log("error", error)
       }
   });
}


上一篇:更改VS2010的[默认开发语言]


下一篇:mysql 协议的server状态标识