jQuery AJAX request failing in IE

前端 未结 8 1198
[愿得一人]
[愿得一人] 2020-11-30 03:42

The following AJAX call is failing in IE.

$.ajax({
    url:\"{{SITE_URL}}/content/twitter.json\",
    dataType:\"json\",
    error:function(xhr, status, erro         


        
相关标签:
8条回答
  • 2020-11-30 04:35

    In newer versions of internet explorer (IE7) it is necessary to write the next line before calling $.ajax, otherwise it would never call the function:

    $.ajaxSetup({ cache: false }); //this line before $.ajax!!!
    $.ajax({
        //codes
        //codes
        //codes
    });
    
    0 讨论(0)
  • 2020-11-30 04:36

    One major problem with statically generated JSON and IE are the leading "commas", for examples this throws an error in IE:

    {
        "one":"hello",
        "two":"hi",
     }
    

    Note the last comma.

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