I have tried almost everything, but can't figure this out?
I am creating a list view for my HTML app using JSON and this part was working just fine. But in the same JSON call I want to be able to send other data as well I can put into some variables but am unsuccessfull.
Here is what I am trying:
dataUrl = 'http://mypage.com/playermenu.php?callback=?&userid=' + userid,
dataCallback = function(data){
//var content = data.list.join("");
//var now = data.menutime; // HERE I WANT THE MENUTIME TO BE PUT INTO A VARIABLE //
alert("Date: "+data.menutime);
$('#userbar').html(data.profile); // FETCHING USERS DATA FOR PROFILEBAR //
$('#games').html(content).listview('refresh');
}
$.getJSON(dataUrl, dataCallback);
The above alert gives: Date: undefined
My JSON looks like this:
([{"menutime":"2013-04-28 15:00:50"},{"profile":"troels"}])
Hoping for help with this.
Thanks in advance :-)