欧美一区二区三区,国内熟女精品熟女A片视频小说,日本av网,小鲜肉男男GAY做受XXX网站

如何用ajax提交多組同樣的數(shù)據(jù)數(shù)組到后臺

劉姿婷2年前20瀏覽0評論

如何用ajax提交多組同樣的數(shù)據(jù)數(shù)組到后臺?

下載個jquery.js

用.ajax函數(shù),參數(shù)類型為json,后臺用json_decode解碼就成了數(shù)組了

$("#btn2").click(function() {

$.ajax({

type: "POST",

contentType: "application/json",

url: "server.php",

data: "{name: "aaa", age: "20"}, {name: "bbb", age: "20"}, {name: "ccc", age: "20"}

",

dataType: 'json',

success: function(result) {

alert(result.d);

}

});

});