valid json still fails on IE with jquery's ajax or getJSON callbacks

Posted by lock on Stack Overflow See other posts from Stack Overflow or by lock
Published on 2010-03-22T03:51:04Z Indexed on 2010/03/22 4:01 UTC
Read the original article Hit count: 320

Filed under:
|
|

everytime my page loads, im supposed to create a datatable (also a jquery plugin) but when im fetching the contents, using .ajax or .getJSON always goes straight ahead to the error function, without even telling me what went wrong inside the callback

$.ajax({
    cache: false,
    type: "POST",
    url: oSettings.sAjaxSource,
    data: {'newdate' : date},
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function(json) {
        console.log('retrieving json data');
    },

    error: function() {
        console.log("An error has occurred. Please try again.");
    }
});

that's the actual code with the callback stripped for security purposes...

this works fine in firefox which actually executes what's on the callback function but IE simply fails and proceeds to writing my log

i've read alot that the primary reason the JSON calls fails for IE is whenever there are trailing commas or simply malformed JS

but i used JSONLint already and verified that my json object is a valid one :(

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JSON