window.location.reload,带有清除缓存 [英] window.location.reload with clear cache

查看:200
本文介绍了window.location.reload,带有清除缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用JavaScript重新加载页面,但我也要清除缓存,所以在页面刷新页面上有来自服务器的所有内容的最新版本。

除了IE之外的其他浏览器没有获得最新内容。

I want to reload a page using JavaScript but I want to clear cache too, so on page refresh the page has latest versions of everything from server.
Other browsers except IE are not getting latest content.

IE9的任何解决方案?

Any solution for IE9?

推荐答案

reload()应该接受一个参数,告诉它进行硬重载,即忽略缓存:

reload() is supposed to accept an argument which tells it to do a hard reload, ie, ignoring the cache:

location.reload(true);

我无法保证其可靠性,您可能需要进一步调查此事。

I can't vouch for its reliability, you may want to investigate this further.

这篇关于window.location.reload,带有清除缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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