3 回答

TA貢獻1816條經(jīng)驗 獲得超4個贊
您可以通過JSON或通過普通POST發(fā)送數(shù)據(jù),這是JSON的示例。
var value1 = 1;
var value2 = 2;
var value3 = 3;
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "yoururlhere",
data: { data1: value1, data2: value2, data3: value3 },
success: function (result) {
// do something here
}
});
如果你想通過正常的帖子使用它試試這個
$.ajax({
type: "POST",
url: $('form').attr("action"),
data: $('#form0').serialize(),
success: function (result) {
// do something here
}
});

TA貢獻1830條經(jīng)驗 獲得超9個贊
var countries = new Array();
countries[0] = 'ga';
countries[1] = 'cd';
之后你可以這樣做:
var new_countries = countries.join(',')
后:
$.ajax({
type: "POST",
url: "Concessions.aspx/GetConcessions",
data: new_countries,
...
這件事就像JSON字符串格式一樣。
- 3 回答
- 0 關注
- 1844 瀏覽
添加回答
舉報