JSON polyfill: JSON 2 or JSON 3?

后端 未结 3 954
臣服心动
臣服心动 2020-12-15 18:40

I need a JSON polyfill to support IE 7 and some IE 8 and IE 9 modes. Should I pick JSON 2 or JSON 3? Obviously JSON 3 is a more modern implementation, but for example a site

3条回答
  •  庸人自扰
    2020-12-15 19:05

    Use json2.js if you want to improve the performance of your page in IE7 (and possibly 8). I was happily using json3 for months and then I saw this question and did some research. All of the jsperf's performed 1-2x faster with json2.js in my IE7 VM.

    One example:

    http://jsperf.com/json-vs-jquery-json/2

提交回复
热议问题