Page is a not externally linkable
LinusIT - 8:56 am on Nov 8, 2012 (gmt 0)
I have tried that but as I'm using it outside of the "each (function)" it is coming back with val is undefined, which is correct. If I show the code hopefully this will help.
$(".main-content").html("<table id=\"till\"><thead><tr><th>Reference</th><th>In</th><th>Out</th><th>Details</th></tr></thead><tbody>");
$.each(response, function(key, val) {
$("#till tbody").append('<tr><td id="' + key + '">' + val.ref + '</td><td>' + val.inn + '</td><td>' + val.out + '</td><td>' + val.detail + '</td></tr>');
});
$("#till tbody").append('<tr><td colspan=\"4\">Total Spent:' + val.balance + '</td></tr>');
$("#till tbody").append('</tbody></table>');
I have used alert (JSON.stringify(response)); and can see that the balance is in the alert.