jquery - Internet Explorer 中的 AJAX 问题

标签 jquery ajax internet-explorer

这在 FF、safari、chrome 和 opera 中运行得很好,但在 IE 中不起作用。

错误代码是403

 var datau = "trends.php%3Frastgele%3D33";
 $.ajax({
    type: "GET",    
    url: "loader.php?kk=1&page="+datau,     
    data: "",       
    cache: false,
    success: function (html) {
        $('#content').empty();                  
        $('#content').html(html);
    },
         error:function (xhr, ajaxOptions, thrownError){
         alert(xhr.status);
         alert(thrownError);
          } 
});

最佳答案

您现在应该通过 url 传递 GET 变量。 建议使用以下内容(不要执行 urlencode):

 $.ajax({
    type: "GET",    
    url: "loader.php",     
    data: {"kk": 1, "page": 'trends.php?rastgele=33'},       
    cache: false,
    success: function (html) {
        $('#content').empty();                  
        $('#content').html(html);
    },
         error:function (xhr, ajaxOptions, thrownError){
         alert(xhr.status);
         alert(thrownError);
          } 
});

关于jquery - Internet Explorer 中的 AJAX 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6158477/

相关文章:

javascript - 我需要将一个对象序列化为 JSON。我正在使用 jQuery。有没有 "standard"方法可以做到这一点?

javascript - Bootstrap 3 - 使用切换方法时 Accordion 效果会中断

javascript - 如何在相扑选择下拉列表中显示ajax响应?

c# - 错误请求仅在远程计算机上通过 IE 11 返回用于传递凭据的 XHR

jquery - 将多个参数传递给 $.delegate

javascript - jQuery 验证 AJAX 表单

jquery - 无需刷新即可更改网页内容

ajax - 如何重新加载推特按钮?

jquery - 选择框在 Internet Explorer 中不起作用/消失

css - 具有适当行为的华丽网页按钮,可以做到吗?