在Internet Explorer中的AJAX问题 [英] AJAX problem in Internet Explorer
本文介绍了在Internet Explorer中的AJAX问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这工作在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);
}
});
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);
}
});
这篇关于在Internet Explorer中的AJAX问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文