js json() code example
Example 1: json javascript
// Storing data:
myObj = {name: "John", age: 31, city: "New York"};
myJSON = JSON.stringify(myObj);
localStorage.setItem("testJSON", myJSON);
// Retrieving data:
text = localStorage.getItem("testJSON");
obj = JSON.parse(text);
document.getElementById("demo").innerHTML = obj.name;
Example 2: converting response in json
Json Path
and
Deserialization of Json
using POJO classes.
Example 3: html working with JSON data
superHeroes.homeTown
superHeroes['active']