下载个jquery.js
用.ajax函数,参数类型为json,后台用json_decode解码就成了数组了
$("#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);
}
});
});