IE在Ajax获取/发布后不刷新 [英] IE does not refresh after Ajax get/posts

查看:91
本文介绍了IE在Ajax获取/发布后不刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小问题,我不知道该如何处理.

I have a small problem that I don't know how to deal with.

我已经写了一些jQuery帖子/获取,可以在FF,Opera和Chrome中正常工作.但是,从资源管理器(任何版本)运行时,请求中的更新内容不会加载到浏览器中.我使用了开发人员工具并调试了脚本,并使用正确的参数发送了请求.这些操作甚至都已执行,但是直到我清除浏览器历史记录或打开/关闭浏览器后,该操作才可见.

I've written some jQuery post/gets which work fine in FF, Opera and Chrome. But when run from explorer (any version) the updated content from the request does not get loaded into the browser. I've used developer tools and debugged the scripts, and the requests are sent with correct parameters. The actions are even executed, but it's not visible until I've cleared the browser history or open/close the browser.

这可能是一个愚蠢的问题,但是如何让IE识别这些请求的更改?

This may be a silly question, but how do I get IE to recognize the changes from these requests?

推荐答案

尝试将cache: false参数设置为AJAX请求,因为浏览器可能会缓存GET请求:

Try setting the cache: false parameter to your AJAX requests as browsers might cache GET requests:

$.ajax({
    url: '/foo',
    type: 'GET',
    cache: false,
    success: function(result) {
        // TODO: update the DOM with the results
    }
});

这篇关于IE在Ajax获取/发布后不刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆