I'm trying to get data from data.php via jQuery ajax call.
My code looks like this:
var jsonData;
$.ajax({
url: 'data.php',
success: function(response) {
jsonData = response;
}
});
My data.php file is returning json formatted data but some text is in Unicode format.
I set charset on data.php and on my javascript file, but still cant access responced data objects.
Any ideas?
jsonDatavariable immediately after calling$.ajax()? It would beundefinedat that point because your ajax call is asynchronous. Do your processing inside thesuccesshandler. (If that's not it, please click "edit" and add detail about what "can't access" actually means in this case. What actually ends up in yourresponsevariable?)