I have this code
$('div#create_result').text(XMLHttpRequest.responseText);
where the content of XMLHttpRequest is
responseText: Content-Type: application/json; charset=utf-8
{"error" : "User sdf doesn't exist"}
status: 200
statusText: parsererror
The result I see is
Content-Type: application/json; charset=utf-8 {"error" : "User sdf doesn't exist"}
where I would have liked
User sdf doesn't exist
How do I get just that?
you can use a regular expresion to extract value; something like: