I want to get JSON string to my Jquery Mobile App and add that values in to Java-Script array for future use.
here is the structure of the json
{"daily":[{"a":1,"b":3,"c":2,"d":5,"e":3}]}
here is the link for above daily_report
here is my code
$(document).on('pagebeforeshow', '#pageone', function(e, data){
$.ajax({url: "http://iilsfa.br0s.info/Dashboard/get_daily_report.php",
dataType: "json",
async: true,
success: function (result) {
ajax.parseJSONP(result);
},
error: function (request,error) {
alert('No Network!');
}
});
});
var ajax = {
parseJSONP:function(result){
$.each( result, function(i, row) {
$('#output').append('<li><h3>' + row.a+ '</h3></li>');
// I Need to add json elements to an array here
});
$('#output').listview('refresh');
}
}
- #output is a tag located in #pageone
Above code is not working.please show me how to fix it..thank you..