jquery ajax在IE中无法正常工作?

时间:2014-10-16 17:06:49

标签: jquery ajax

我在jquery中写了一个ajax。除了IE之外,它在所有浏览器中都运行良好。谁能告诉我代码有什么问题?

    $.ajax({
        type: "GET", 
        url: MasterVariable.SiteUrl + "/Goals/GetAllGoals",  
        contentType: "application/json", 
        dataType: "html",
            data: "{}",
            success: function (result) {
               $(".jQGoalList").html(result);
            },
            error: function (err) {
             alert("Error = " + err.statusText);
            }
        });

1 个答案:

答案 0 :(得分:0)

我之前遇到同样的问题。尝试在你的ajax中使用“cache:false”。

   $.ajax({
            type: "GET", 
            url: MasterVariable.SiteUrl + "/Goals/GetAllGoals",
            contentType: "application/json", dataType: "html",
            data: "{}",
            cache: false,
            success: function (result) {
                $(".jQGoalList").html(result);
            },
            error: function (err) {
                alert("Error = " + err.statusText);
            }
        }); 

在IE中“cache:false”将解决您的问题。

相关问题