在Internet Explorer中的AJAX问题问题、Internet、Explorer、AJAX

由网友(白鹿)分享简介:这工作在FF,Safari浏览器,Chrome和Opera非常好,但不能在IE浏览器。错误code为403 VAR datau =trends.php%3Frastgele%3D33;$阿贾克斯({键入:GET,网址:loader.php KK = 1&安培;网页=?+ datau,数据: ,缓存:假的,成功:函数(H...

这工作在FF,Safari浏览器,Chrome和Opera非常好,但不能在IE浏览器。

错误code为403

  VAR datau =trends.php%3Frastgele%3D33;
 $阿贾克斯({
    键入:GET,
    网址:loader.php KK = 1&安培;网页=?+ datau,
    数据: ,
    缓存:假的,
    成功:函数(HTML){
        $('#内容),空();
        $('#内容)HTML(HTML);
    },
         错误:函数(XHR,ajaxOptions,thrownError){
         警报(xhr.status);
         警报(thrownError);
          }
});
 

解决方案

您现在应该经过URL GET变量。 下面的建议(不做urlen code):

  $。阿贾克斯({
    键入:GET,
    网址:loader.php
    数据:{KK:1,网页:?trends.php rastgele = 33'},
    缓存:假的,
    成功:函数(HTML){
        $('#内容),空();
        $('#内容)HTML(HTML);
    },
         错误:函数(XHR,ajaxOptions,thrownError){
         警报(xhr.status);
         警报(thrownError);
          }
});
 
internet explorer发生故障

This works in FF,safari,chrome and opera very well, but doesn't in IE.

The error code is 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. The following is recommended (don't do 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);
          } 
});

阅读全文

相关推荐

最新文章