JSON数据格式

 

       var oCar = new Object();

       oCar.doors = 4;

        oCar.color = "blue";

       oCar.year = 1995;

       oCar.drivers = new Array("Penny", "Dan" , "Kris");

       document.write(JSON.stringify(oCar));

这段代码将输出如下所示的JSON 字符串:

// [] 数组 {}对象

{"doors" : 4, "color" : "blue", "year" :1995, "drivers" : ["Penny", "Dan" , "Kris"]}

阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页