参考:http://www.cnblogs.com/youring2/archive/2013/03/01/2938850.html


github地址:https://github.com/douglascrockford/JSON-js

序列化,json对象化转string

 var jsonObj = { id: '1', name: 'Tom Green' };
 var jsonStr=JSON.stringify(jsonObj)

输出结果:{"id":"1","name":"Tom Green"}

反序列化 string 转json 对象

  var jsonString = '{ "id": "01", "name": "Tom Green" }';
   var jsonObj = JSON.parse(jsonString);
 

相关文章:

  • 2022-12-23
  • 2021-05-27
  • 2021-04-01
  • 2022-12-23
  • 2021-10-03
  • 2022-12-23
  • 2022-01-05
  • 2021-09-09
猜你喜欢
  • 2022-02-16
  • 2022-12-23
  • 2021-08-23
  • 2021-06-27
  • 2022-12-23
相关资源
相似解决方案