I keep getting an error parsing what seems to be valid JSON. The parse call is done ina handler to an Ajax call to a php script that is returning:
echo json_encode(array("success"=> false, "error_message"=> "error"));
The code bit handling the response:
function(returnedData){
console.log(returnedData);
var response = JSON.parse(returnedData);
The console.log call is printing
{"success":false,"error_message":"error"}
If I take this, put it between quotes and manually call JSON.parse in the console, then it works fine.
Any ideas what might be going wrong? Thanks in advance!