I've tried getting information with JSON only with one function, and it works fine. When it becomes two or more though it was pointed out that an array of array should be used.
How can you decode this information?
get.php
$response = array("home"=>$home, "topr"=>$top);
echo json_encode($response);
test.js
$(document).ready(function() {
$.get("php/get_ratings.php")
.done(function(data) {
var results = jQuery.parseJSON(data); // Should I change this?
$.each(results, function(i, value) { // Or this?
})
});
});