<script>
if(window.name!="bencalie"){
  location.reload();
  window.name = "bencalie";
}
else{
  window.name = "";
}
</script>

解决方案 »

  1.   

    直接放到页面源代码里面即可<script>
    if(window.name!="bencalie"){  //如果window.name不是指定字符串就刷新并赋值为制定字符串
      location.reload();
      window.name = "bencalie";
    }
    else{  //如果window.name是指定字符串,就设置为空,以便下次进入该页面再刷新
      window.name = "";
    }
    </script>
      

  2.   

    非常感谢bencalie(Bencalie)对我这个问题的回答,还有一个小小问题:我的页面是在框架里的,左边为引导链接,右边为内容。刷新的为右边内容页,在使用了以上代码后,框架页左面的引导链接只能使用一次,再使用时就会打开一个新的IE,并显示出内容。不知能否解决??
    谢谢!
      

  3.   

    对于这种问题你可以强制设置网页不在客户端缓存, 这样就可以保证每次打开这个页面都是最新的禁用客户端缓存
    HTML
        <META HTTP-EQUIV="pragma" CONTENT="no-cache">
        <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
        <META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1978 08:21:57 GMT">
    ASP
    <%
        Response.Expires = -1
        Response.ExpiresAbsolute = Now() - 1
        Response.cachecontrol = "no-cache"
    %>
    PHP
        header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
        header("Cache-Control: no-cache, must-revalidate");
        header("Pragma: no-cache");
    JSP
        response.setHeader("Pragma","No-Cache");
        response.setHeader("Cache-Control","No-Cache");
        response.setDateHeader("Expires", 0);
    C#中禁止cache的方法!
        Response.Buffer=true;
        Response.ExpiresAbsolute=System.DateTime.Now.AddSeconds(-1);
        Response.Expires=0;
        Response.CacheControl="no-cache";
      

  4.   

    要每次刷新都是最新的内容,用和csdn一样的随机查询串。
    服务器端的办法不管用