JQuery Technique: Parse JSON data

A couple of very simple and intuitive code examples to parse data received in JSON format: var resultJSON = ‘{“FirstName”:”John”,”LastName”:”Doe”,”Email”:”johndoe@johndoe.com”,”Address”:”123 dead drive”}’;var result = $.parseJSON(resultJSON);$.each(result, function(k, v) { //display the key and value pair alert(k + ‘ is ‘ + v);}); Or var obj = $.parseJSON(resultJSON);for (var prop in obj) { alert(prop + ” is […]

Continue Reading