I am retrieving some info through $.get from a ajax.php script. In the ajax.php script i get different numbers form a database which i want to update live on the site.
However, now i have run into the problem that some of the values that come from the DB are decimal ones, like: 0.79
When i JSON encode them in the ajax.php script they are returned fine for ex: o_epc:"0.71" but for some reason my $.get doesent understand this value and returns it as null
Any ideas on how to get this to work?
Here is my $.get call
$.get("ajax.php", { opt: "networkStats", o_id: b }, function(r) {
var j = eval('(' + r + ')');
if(j.message) {
console.log(j.message);
}
});
This is how i encode my json
$epc = (float) $db['o_epc'];
$RET['message']['o_epc'] = $epc;
die(json_encode($RET));