使用 Fiddler 监控 Jquery post 我在 fiddler 中出错。
unquoted Identifier 'Id' at position 0
我错过了什么?
var UserModel =
{
Id: "12345",
Name: "MyName"
};
$.ajax({
type: "POST",
url: '@Url.Action("MyAction")',
data: UserModel,
datatype: 'json',
contentType: "application/json",
success: function (response) {
alert("Success");
}
});
最佳答案
你忘了引号
var UserModel =
{
"Id": "12345",
"Name": "MyName"
};
关于javascript - JQuery 发布 JSON 数据抛出错误, "unquoted Identifier ' Id' 在位置 0",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33131105/