以下三种ajax写法,供大家参考
1. $.ajax({
url: "/ObjectType/UpdateType",
type: 'post',
dataType: 'json',
data: { Info: resultinfo },
success: function (Json) {
},
errorr:function (Json) {
},
});
2. $.ajax("/Report/Generate", {
method: "post",
data: { Info: resultinfo },
}).done(function (result) {
alert(result)
}).fail(function (result) {
alert(result)
})
3. $.post("@Url.Action("Confirm", "MobileAlarm", new { Info=resultinfo})", function (data){
alert(data)
}).fail(function (error) {
alert(error)
});