我通过此代码传递数据,但它不起作用:
$.ajax({
url: '@Url.Action("Edit_we","storemanager")',
type: "POST",
data: JSON.stringify(obj),
dataType: "json",
contentType: "application/json; charset=utf-8",
success: function(data)
{
alert("your data is saved")
},
error: function () {
alert("An error has occured!!!");
}
});
答案 0 :(得分:0)
$.ajax({
url: "service.xxx",
type: "POST",
data: {variable: JSON.stringify(obj)},
dataType: "json",
success: function(data)
{
alert("your data is saved")
},
error: function () {
alert("An error has occured!!!");
}
});
{p}为url
提供支持服务的绝对或相对路径,并使用变量接受来自前端的数据。