简体   繁体   English

Internet Explorer 中的 AJAX 问题

[英]AJAX problem in Internet Explorer

This works in FF,safari,chrome and opera very well, but doesn't in IE.这适用于 FF、safari、chrome 和 opera,但在 IE 中不起作用。

The error code is 403错误代码是 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);
          } 
});

You should now pass GET variables by url.您现在应该通过 url 传递 GET 变量。 The following is recommended (don't do urlencode):推荐以下(不要做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);
          } 
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM