I'm using the pmxdr library to make a cross domain call (jQuery to php and respond in json). The problem is I can not handle the response properly but if I just print it on HTML is comes as -
{"title":"Mr","first_name":"Shak","last_name":"Mana"}
Here is the code it use
pmxdr.request({
uri : "http://xxxx/pmxdr/respons1.php",
callback: handleResponse
});
function handleResponse(response) {
if (!response.error) { // request successful
console.log(response.headers["content-type"]) //works
console.log(response.data) //works
for (var key in response.data) {
alert(response.data[key]); // gives each character :(
}
} else print("Error: " + response.error);
}
on the console I get the above mentioned json but on the alerts I get each character separate popping out. if I use console.log(response.data["title"])
it says undefined. Please tell me what I'm doing wrong.