How to parse the attached JSON in Javascript -
the next valid. how access info using json.parse
.
[ { "node_title": "mgp", "nid": "4", "album": "myalbum1", "artist": "myartist" }, { "node_title": "pw", "nid": "3", "album": "myalbum1", "artist": "myartist" } ]
use
var jsonstring= '[ {"node_title": "mgp", "nid": "4", "album": "myalbum1", "artist": "myartist"}, {"node_title": "pw", "nid": "3", "album": "myalbum1", "artist": "myartist"} ]' var jsonformatvariable = jquery.parsejson(jsonstring); // in jquery library parse; var jsonformatvariable = json.parse(jsonstring); // in native js parse; console.log(jsonformatvariable );
javascript json
No comments:
Post a Comment