1.
//创建一个测试数组 var array = new Array(); boxIds.push(12182); boxIds.push(12183); boxIds.push(12184);
2.
var arr = new Array(); arr[0] = 1; arr[1] = "a"; arr[2] = '无线';
3.
var a = new Array(1, 2, 3, 4, 5); var b = [1, 2, 3, 4, 5];
4.多维数组
(1).
var a = new Array(); a[0] = new Array(); a[0][0] = 1;
(2).
var a = new Array([1,2,3], [4,5,6], [7,8,9]); var b = [[1,2,3], [4,5,6], [7,8,9]];
5.复杂多维
var data = { "ab":0, "data": { "Text": { "text": "附近的地点" }, "Image": { "url": "imageUrl" }, "Info": { "location": { "city": "西安", "province": "北京", "street": "上海" } } }, "userInfo": { "Key": "", "Id": "" } }
这样就可以直接通过 ajax 发送
$.ajax({
type: "POST",
url: " ~~~~~~~~~~~~ ",
data: data,
dataType: "json",
success: function(msg){
console.log(msg)
}
});