I have a problem with processing a JSON object.
When I do echo the result I get this:
result : undefined

$.post("./php/date_information.php", function(temp){
alert(temp.weekNumber); // HERE
$('select[name="week"]').val(temp.weekNumber);
});
but when I change my code I get this
result : {"year":"2018","weekNumber":"39","status":"200"}

$.post("./php/date_information.php", function(temp){
alert(temp); // Here
$('select[name="week"]').val(temp.weekNumber);
});
PHP script return (JSON FORMAT):
{"year":"2018","weekNumber":"39","status":"200"}
I have no idea why JQuery doesn't take temp.weekNumber. Any ideas?