标签:
ajax:
$.ajax({
type: "post",
datatype: "json",
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
url: "/ProductTypeAndCat/AddType",
async: true,
cache: false,
data: { typeName: typeName },
success: function (data) {
if (data.F == 1) {
alert(data.M);
return;
}alert("添加成功!");
location.href = "/Admin/ProductType";
},
error: function (xhr, status, error) {
alert(error);
}
});
form提交:
$(‘#frmDemo‘).ajaxSubmit({
type: "post",
url: "/ProductTypeAndCat/AddCategory",
success: function (data) {
if (data.F == 1) {
alert(data.M);
return;
}alert("添加成功");
location.href = "/admin/createProductCategory";
},
error: function (xhr, status, err) {
alert(err);
}
});
标签:
原文地址:http://www.cnblogs.com/luminji/p/4741840.html