Skip to main content

Posts

Showing posts with the label Javascript

Converting JSON string to JavaScript object

Javascript has an inbuilt library object to handle json data. In order to convert a json string to an object, you can use the following method call: var obj = JSON.parse("jsonString")  for the other way around : var jsonString = JSON.stringify(obj); Check out the site  http://jsonlint.com/. It's very useful to format json strings.