仅针对IE8使用jQueryAjax时的不一致性
我正在将一个html内容加载到一个div中,其中包含一些表格格式的图像和文本。它在firefox和chrome中工作没有任何问题。但在IE8中,它只能工作有限的次数。然后那边什么也没来。奇怪的是,其他javascript操作也不起作用。请帮忙。我在没有太多知识的情况下和它战斗了两天 代码:仅针对IE8使用jQueryAjax时的不一致性,jquery,ajax,internet-explorer-8,Jquery,Ajax,Internet Explorer 8,我正在将一个html内容加载到一个div中,其中包含一些表格格式的图像和文本。它在firefox和chrome中工作没有任何问题。但在IE8中,它只能工作有限的次数。然后那边什么也没来。奇怪的是,其他javascript操作也不起作用。请帮忙。我在没有太多知识的情况下和它战斗了两天 代码: 但是,如果我给$.post,它只会发生一次,而不是xmlhttp,但其他的都正常工作。同时,如果我在这里的某个地方给出一些警告声明,那么它每次都会出现 if($.browser.msie){
但是,如果我给$.post,它只会发生一次,而不是xmlhttp,但其他的都正常工作。同时,如果我在这里的某个地方给出一些警告声明,那么它每次都会出现
if($.browser.msie){
$.ajax({
type: "POST",
xhr: (window.ActiveXObject) ?
function() {
try {
return new window.ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {}
} :
function() {
return new window.XMLHttpRequest();
},
url: './ajax_funcs.php?func=to_box',
data: {id_to:id,enc_id:enc_id},
success: function(data){
$('.current_action_to').hide();
$(current_action_to_id).center_to();
$(current_action_to_id).html(data);
$(current_action_to_id).show();
}
});
}
else{
$.post('./ajax_funcs.php?func=to_box',{id_to:id,enc_id:enc_id},function(data){
$('.current_action_to').hide();
$(current_action_to_id).center_to();
$(current_action_to_id).html(data);
});
$(current_action_to_id).ajaxComplete(function(){
$(current_action_to_id).show();
});
}