As someone who is just starting out with PhoneGap, I have been looking at similar questions about parsing JSON data.
Unfortunately, the explanations provided in those questions are not detailed enough for me.
Below is the code I am using to fetch the JSON response:
function GetData() {
var jqxhr = $.getJSON('http://api.geonames.org/postalCodeLookupJSON?postalcode=6600&country=AT&username=demo', parseResult)
.error(function () {
alert('error');
});
}
function parseResult(tx) {
alert("Success");
alert(JSON.status.itemList);
var data = JSON.parse(tx);
alert(data);
}
I am seeking guidance on how to display the received data in an alert view and how to properly parse the response.
Any assistance on this matter would be greatly appreciated.