dpb75177 2014-01-28 19:12
浏览 74
已采纳

AJAX加载功能在IE10中不起作用

I have just finished my first AJAX request and got it working in Google, Safari Firefox ETC. It is very basic and just calls a PHP query with a random result and shows this inside a DIV. I then tested it in IE10 and the AJAX does not work. When i refresh teh page i get a new result but it does not refresh after 3 seconds. This is the code

$(function() {
    getStatus();
});

function getStatus() {
    $('div#status').load('thankyou.php')
    setTimeout("getStatus()",3000);
    setTimeout(function(){$("getstatus").html(getStatus)},3000);
}

I have looked for answers and got

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" >

between my head and head. It cured another issue i was having with a jquery rotator but not the AJAX. Is it my code or IE10? and any known soulutions?

  • 写回答

1条回答 默认 最新

  • dongsha7215 2014-01-29 07:41
    关注

    Thanks to Crush and DownMaster i looked at the problem in a different way. By preventing the AJAX page being cached seems to makes it work, adding $.ajaxSetup({cache: false}); prevents the cache.

    $(function() {
    getStatus();
    });
    function getStatus() {
    $.ajaxSetup({ cache: false });//prevents the AJAX cache.
    $('div#status').load('thankyou.php')
    setTimeout("getStatus()",3000);
    setTimeout(function(){$("getstatus").html(getStatus)},3000);
    } 
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料