Json 有兩個方法:javascript
1.JSON.stringify();//javascript 對象序列化爲JSON字符串。java
2.JSON.parse();//JSON字符創解析成爲原生的javascript的值。spa
var book={ "title":"Professional Javascript", "authors":[ "Nicholas C. Zakas" ], edition:3, year:2011 };
輸出的結果:code
{"title":"Professional Javascript","authors":["Nicholas C. Zakas"],"edition":3,"year":2011}
而Json.pare()結果是Object 對象。對象