Ok so I've been dealing with a PHP 5.3 server returning a hand-made JSON (because in 5.3 there's no JSON_UNESCAPE_UNICODE
in the json_encode
function) and after reading this thread and making some tests, I think I've found a problem in jQuery's parseJSON
function.
Suppose I have the following JSON:
{
"hello": "hi\nlittle boy?"
}
If you check it using jsonlint.com you can see it's valid JSON. However, if you try the following, you get an error message:
$(function(){
try{
$.parseJSON('{ "hello": "hi\nlittle boy?" }');
} catch (exception) {
alert(exception.message);
}
});
I've opened a bug report at jQuery, because I think it's a proper bug. What do you think?