var students = [];
students[students.length] = new Object();
students[students.length] .name = "Lanny";
students[students.length] .age = "25";
students[students.length] .location = "China";
var json = JSON.stringify(students);
var student = new Object();
student.name = "Lanny";
student.age = "25";
student.location = "China";
students = (students || []).push(student);
var json = JSON.stringify(students);
var arr = [];
arr[0] = {name: value 。。。};
arr[1] = {name: value 。。。};
js是弱类型语言。
你可以自己在页面拼成json格式字符串,然后传到后台啊。
例如“{name:'25',age:'25'}”;