Quick question. Is there any need to include the Json2 library anymore? Did I read somewhere that JavaScript supports JSON as standard these days so there's no need to parse it anymore?
Any advantages or disadvantages to Json2 vs standard JavaScript support?
JSON
was standardised in ECMAScript 5, so browsers that conform to that specification include JSON
, but others browsers don't (such as those that were released before ECMAScript 5/ IE). If you need to support these browsers, you still need to include it.
Specifically, JSON
was introduced in:
json2.js
checks whether JSON.parse
is already implemented, and only provides it's implementation if it doesn't; so think of it as a sort of polyfiller for older browsers.
Sources: http://kangax.github.com/es5-compat-table/, http://caniuse.com/#feat=json
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With