weixin_33709219 2015-07-10 07:11 采纳率: 0%
浏览 24

Ajax不会在IE 11中重新加载

My code works flawlessly in chrome, however the AJAX doesn't reload in IE. Link to my code, suggestions? It loads at first but refuses to reload the page. I'm very stuck and I'd like to use only JavaScript if possible, I am open to use jQuery solution too.

  • 写回答

2条回答 默认 最新

  • weixin_33716154 2015-07-10 07:15
    关注

    By default, IE caches your AJAX calls. So, in order to make sure that a call is send, just add a time stamp. You need to update

    xmlhttp.open("GET","chat.php",true);
    

    to

    xmlhttp.open("GET","chat.php?t=" + new Date().getTime(),true);
    
    评论

报告相同问题?