I'm receiving the following error message in Firefox:
Error: not well-formed
Source File: http://school/courses.booking.add.php?1287657494723
Line: 1, Column: 1
Source Code:
{"type":"error","message":"You have already booked this course."}
As you can see, the output is valid JSON (it's created by PHP's json_encode()
function). And it's served with the application/json
MIME type. I thought the error might be something to do with the parsing:
eval: function(json) {
return eval('(' + json + ')');
}
But even if I don't parse the string, and simply alert the returned JSON response, the error still shows up.
Related Question: http://stackoverflow.com/questions/677902/not-well-formed-error-in-firefox-when-loading-json-file-with-xmlhttprequest. His solution was to fix the MIME type. Mine's already accurate, so it must be something else.