jQuery, ajax request doesn't success with JSON on IE

Posted by sylouuu on Stack Overflow See other posts from Stack Overflow or by sylouuu
Published on 2011-12-12T21:56:18Z Indexed on 2012/11/16 11:01 UTC
Read the original article Hit count: 227

Filed under:
|
|
|

I made an AJAX call and it works on FF & Chrome but not on IE 7-8-9. I'm loading a JSON file from my domain:

    $.ajax({
        url: 'js/jquery.desobbcode.json',
        dataType: 'json',
        cache: false,
        success: function(json) {
            alert('ok');
        },
        error: function(xhr, errorString, exception) {
            alert("xhr.status="+xhr.status+" error="+errorString+" exception="+exception);
        }
    });

I also tried by adding contentType: 'application/json' but I receive the same output which is :

xhr.status=200
error=parsererror
exception=SyntaxError Unterminated string constant

I checked my JSON file with JSONLint and it's OK. I checked if there is an extra comma and the content is also trimmed. See my JSON file

If I put dataType: 'text', I receive the OK alert but a debug popup too.

Could you help me? Regards.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about AJAX