javascript下的json 序列化及反序列化

95 阅读1分钟

1、序列化

将json对象转为字符串:

JSON.stringify(jsonObj)\

\

2、反序列化

var jsonObj = eval("(" + jsonstring + ")");