Need to solve IE 8 Jquery problem

后端 未结 3 933
闹比i
闹比i 2021-01-23 13:36

In my development, I came on a strange problem. The following is my jquery code to load 2 datepicker when the page load, those 2 datepickers are disable the dates which are not

相关标签:
3条回答
  • 2021-01-23 14:14

    there are json library

    JSON.parse('[{"some":"json"}]');
    JSON.stringify([{some:'json'}]);
    

    Reference

    0 讨论(0)
  • 2021-01-23 14:22

    Can you try this:

    change dataType to text

    and eval the data.

    natDays = eval('(' + data + ')');

    0 讨论(0)
  • 2021-01-23 14:23

    I remember having trouble in similar cases in IE when I did not specify what response format I expected. Try setting dataType in the ajax request like so:

    $.ajax({
        type: "GET",
        url: "include/getdate.php",
        data: dataString,
        dataType: 'json',
        success: successCallback
    }
    

    Also if you want to catch errors you should be able to specify an error callback like so:

    $.ajax({
        ....
        error: errorCallback
        ....
    }
    
    function errorCallback(jqXHR, textStatus, errorThrown) {
        alert(jqXHR);
        alert(textStatus);
        alert(errorThrown);
    }
    

    That should help with debugging.

    0 讨论(0)
提交回复
热议问题