Hello everyone…
I have been struggling with this all day long and simply cannot find the problem
I have an Ajax post triggering a php script and want to return to values as the response to update the div boxes. For some reason the info wont display. When i console.log I get the object containing the array but no result.
Here is the code :
$.ajax({
type:"POST",
url: "getlessoninfo.php",
data: {lcode:lcode},
dataType: "json",
success: function(response) {
var new_data = JSON.parse(response);
var instruct = new_data.response1;
var video = new_data.response2;
$('#instructions-info').html(instruct);
$('#video-info').html(video);
},
error: function(response) {
console.log(response);
}
});
----------- PHP --------------
echo json_encode(array(
'response1' => $instructions,
'response2' => $video
));