2 回答
TA贡献1811条经验 获得超6个赞
temp="string";
// (0)
var myJson = JSON.stringify(temp);
$.ajax(
{
url: '/MemoryGame/updateStatus?updatedJson=' + temp, // (1)
type: 'POST',
contentType: "application/json; charset=utf-8",
dataType: "json",
data: '', // (2)
success: function (response) {
alert("success");
if (response == 'Okay') {
checkStatus(response.myID);
}
else {
ConnectionChanged();
}
},
error: function (errorThrown) {
ConnectionChanged();
}
});
或者,如果这不必作为参数传递,请执行以下操作:(0) var formData = new FormData();formData.append('updatejson', temp);(1) url: '/MemoryGame/updateStatus', (2) data: formData,
添加回答
举报