I've been facing an issue with working on my JSON result in JavaScript. Can anyone provide some insight?
Even though the JSON call returns a success status code (200) and I can view the data in Firebug, no alert is being displayed.
$(document).on('pageinit', function(event){
...
$('.link').on('click', function (event) {
var parm = $(this).attr("data-parm");
var url = 'http://****:8000/service?parameter=' + parm;
$.getJSON(url, function (data) {
var result = $.parseJSON(data);
alert(result[1].emnam);
parse(result);
});
});
});
function parse( result ) {
alert( 'parse function' );
}
In the browser (using Firebug or Chrome Dev Tools), this is how my JSON result appears:
{success: "true",
msg: "Data retrieved",
data: [
{pernr: "00001032", emnam: "Michaela"},
{pernr: "00001016", emnam: "Mike"},
{pernr: "00001024", emnam: "Frank"}
]}
Ultimately, I am aiming to dynamically append the listview into the div #list, displaying pernr and name as columns. Any suggestions would be appreciated!