Ok so I am able to return the JSON file fine,
But what I don’t know if how get the right colum (sorry if that make no sence)
Here is the JSON output
[{"total":"85.91"}]
I want to be able to get the word total
As what plain was and is to have one $.ajax function doing all the posting back and forth to the server.
I have never done it this way but hope it can be done.
Here is my jQuery code
function fetchpage(e,formstring)
{
$.ajax({
type: 'POST',
url: 'system/classes/core.php',
data: formstring,
dataType: 'json',
success: function(data){
$.each(data,function(i,myinfo){
alert(data[0]);
});
},
error: function(data){
$.each(data,function(i,myinfo){
alert(i);
});
}
});
}
I’m assuming you want to retrieve the object keys rather than accessing each directly, eg
obj.total.Try the following…