【发布时间】:2021-06-20 20:26:24
【问题描述】:
$.ajax({
url : 'saveeolref',
type:"POST",
cache:false,
data:{
"probId": probid,
"rowid": rowid,
"ord": order},
dataType: "json",
contentType: "application/json; charset=utf-8",
success: function (response) {
alert(response);
},
error: alert('fail')
});
<button type="button" onclick="updateRef()">Submit</button>
- Ajax 调用
$.ajax({
url : 'saveeolref',
type:"POST",
cache:false,
data:{
"probId": probid,
"rowid": rowid,
"ord": order},
dataType: "json",
contentType: "application/json; charset=utf-8",
success: function (response) {
alert(response);
},
error: alert('fail')
});
【问题讨论】:
-
Javscript 事件:
-
如果您有更多详细信息,请单击“编辑”链接并将其添加到问题中。
-
你能分享你打电话的网址吗?
-
你为什么有
contentType: "application/json"? jQuery 不会将对象作为 JSON 发送,而是将其作为 URL 编码的字符串发送。 -
为什么AJAX代码发了两次?
标签: jquery ajax spring spring-mvc