五个基础 JSON范例。
<script type="text/javascript">
//json格式,这是只有一个人。
var people = {firstname:"zhang1",lastname:"xxxx1",email:"kengni@125.com"};
alert(people.email);
</script>
<script type="text/javascript">
//如果有多个人是并列的,就相于一个数组,里面有多个人。
var people = [
{firstname:"zhang1",lastname:"xxxx1",email:"kengni@125.com"},
{firstname:"zhang2",lastname:"xxxx2",email:"kengni@126.com"}
];
alert(people[1].lastname);......
阅读全文