How to parse JSON in JavaScript?

Most browsers support JSON.parse() which is defined in ECMA-262 5th Edition (the specification that JS is based on). Its usage is simple.

First of all, you have to make sure that the JSON code is valid. After that, I would recommend using a JavaScript library such as jQuery or Prototype if you can because these things are handled well in those libraries. On the other hand, if you don't want to use a library and you can vouch for the validity of the JSON object, I would simply wrap string in an anonymous function and use the eval function.

This is not recommended if you are getting the JSON object from another source that isn't absolutely trusted because the eval function allows for renegade code if you will. Here is an example of using the eval function.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions