【发布时间】:2014-01-14 00:03:04
【问题描述】:
单击 href 时,我有以下内容可以刷新我的页面。
<a href="javascript:history.go(0)">Click to refresh the page</a>
我有这个
<meta http-equiv="no-cache">
在head标签中。即使这样,我也得到了一个缓存副本。如何避免加载缓存副本?
【问题讨论】:
标签: html browser-cache
单击 href 时,我有以下内容可以刷新我的页面。
<a href="javascript:history.go(0)">Click to refresh the page</a>
我有这个
<meta http-equiv="no-cache">
在head标签中。即使这样,我也得到了一个缓存副本。如何避免加载缓存副本?
【问题讨论】:
标签: html browser-cache
而不是
javascript:history.go(0);
你可以使用
javascript:window.location.reload();
【讨论】:
<a onclick="window.location.href=this">test</a>
【讨论】:
在您的<meta> 标记中,您缺少内容属性。试试这个
<meta http-equiv="expires" content="0" />
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="expires" content="-1" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
你也可以试试
<a href="javascript:window.location.reload();">
但我不确定这在缓存方面如何工作
【讨论】:
试试这个
window.location.href=window.location.href
【讨论】:
试试这个:
<a class="refresh_link" href="javascript:void(0)">click to Refresh the Page</a>
<script type="text/javascript">
$(document).ready(function(){
$(".refresh_link").click(function(){
location.reload();
});
});
</script>
使用jquery
【讨论】: