After lot of temptatives and after reading lot of posts about I'm still unable to read mySQL fields using Jquery. My PHP code, which connects to a db and gets some data, outputs the following using echo json_encode($html);:
{"id":"1","title":"this_is_title","description":"this_is_description","url":"this_is_url"}
I then try to read the single fields but I keep getting "undefined". For example:
$.getJSON("get.php", function(result) {
$.each(result, function(key, field){
console.log(field.title);
});
});
If I simply use field instead of field.title it works but I get all the fields (of course).