Alternatives of JSON.stringify() in JavaScript

前端 未结 1 1223
轮回少年
轮回少年 2020-12-01 03:05

In JavaScript, what are the alternatives of JSON.stringify() for browsers that do not have native JSON support? Thanks

相关标签:
1条回答
  • 2020-12-01 03:41

    You should use the library json2.js. It is the basis for the standard JSON.stringify(...) that some browsers include natively.

    You can find the page it originated from here: https://github.com/douglascrockford/JSON-js/blob/master/json2.js

    The script automatically makes sure it only adds a JSON.stringify(...) method if it doesn't already exist so there is no danger including it in a browser that has it.

    0 讨论(0)
提交回复
热议问题