You need to JSON.parse()
your valid JSON string.
var str="{"hello":"world"}";
try {
var obj = JSON.parse(str); // this is how you parse a string into JSON
document.body.innerHTML += obj.hello;
} catch (ex) {
console.error(ex);
}
More Related Contents:
- How Can i Change the style of my angularjs object?
- Convert JS object to JSON string
- Parse JSON String into a Particular Object Prototype in JavaScript
- Sum JavaScript object propertyA values with the same object propertyB in an array of objects
- Which characters are valid/invalid in a JSON key name?
- Convert object string to JSON
- How to get object length [duplicate]
- Sorting a JSON object in Javascript
- Merge keys array and values array into an object in JavaScript
- How to access nested JSON data
- Javascript group objects by property [closed]
- JSON.stringify function
- How to write data to a JSON file using Javascript
- Encoding Javascript Object to Json string
- traversing through JSON string to inner levels using recursive function
- Is there any possibility to have JSON.stringify preserve functions?
- Multiple arguments vs. options object
- Push JSON Objects to array in localStorage
- Download JSON object as a file from browser
- jQuery returning “parsererror” for ajax request
- Which way is best for creating an object in JavaScript? Is `var` necessary before an object property?
- Get data from PHP array via AJAX and jQuery
- Remove a JSON attribute [duplicate]
- JSON security best practices?
- How can I get a list of the differences between two JavaScript object graphs?
- Get the property of the difference between two objects in javascript
- How to send data from HTML form to Google Spreadsheet using JavaScript?
- How to make javascript fetch synchronous?
- Why does JSON.stringify return empty object notation “{}” for an object that seems to have properties?
- Object referencing its own property on initialization [duplicate]