jquery ajax

  $.ajax({
                    contentType: "application/json; charset=utf-8",
                    type: "POST",
                    url: "/Registration/ManagementProject/DeleteProjectById",
                    dataType: "json",
                    data: {"selectData": that.UserIdArray },
                    async: false,
                    //提交前设置参数
                    beforeSend: function (request) {
                        //request.setRequestHeader("token", $("#token").val());
                    },
                    error: function (request) {
                        console.log(request);
                        alert(request);
                    },
                    success: function (data) {
                        that.projectList = data;
                        console.log(data)
                        if (data.Response.ErrCode == "0") {
                            alert(data.Response.ErrMsg);
                            //清空已选择的数据
                            that.UserIdArray = [];
                            appList.GatProjectList(1);
                        }
                    }
                });
原文地址:https://www.cnblogs.com/happygx/p/8979453.html