Html 单击链接时刷新页面

Html 单击链接时刷新页面,html,browser-cache,Html,Browser Cache,单击href时,我有以下内容可以刷新我的页面 <a href="javascript:history.go(0)">Click to refresh the page</a> 我有这个 <meta http-equiv="no-cache"> 在头标签中。即使这样,我也会得到一个缓存副本。如何避免加载缓存副本?试试这个 window.location.href=window.location.href 在标记中,缺少内容属性。试

单击href时,我有以下内容可以刷新我的页面

    <a href="javascript:history.go(0)">Click to refresh the page</a>

我有这个

    <meta http-equiv="no-cache"> 

在头标签中。即使这样,我也会得到一个缓存副本。如何避免加载缓存副本?

试试这个

window.location.href=window.location.href
标记中,缺少内容属性。试试这个

<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();">

但我不确定这在缓存方面是如何工作的


<a onclick="window.location.href=this">test</a>
试试这个:

   <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>

$(文档).ready(函数(){
$(“.refresh_link”)。单击(函数(){
location.reload();
});
});
使用

代替

javascript:history.go(0);
你可以用

javascript:window.location.reload();

没用。。。仍在加载缓存的副本,这将更加跨浏览器,没有任何用处。包含jQuery库also@Benny,至少得到了更新?首先尝试清除浏览器缓存。