【发布时间】:2018-02-17 19:10:10
【问题描述】:
好的,我是一个新的 Ajax 调用,我想知道是否可以在 Ajax 调用中发送多个参数。
在我的$.Ajax 中,我正在发送一个对象和一个字符串。
$.ajax({
type: 'POST',
url: urlAction,
cache: false,
data: JSON.stringify(customer,telephone),
contentType: "application/json; charset=utf-8",
success: function (data) {
//Do something
},
error: function (xhr, ajaxOptions, thrownError) {
//Do something
}
});
是否可以在data 中发送多个参数?或者在这种情况下,最好将telephone 视为customer DTO 的一部分?
我的JsonResult 正在尝试接收customer 和string telephone,但电话无效
【问题讨论】:
-
例如,您可以发送一个包含您的数据的对象。