• html 刷新重载方法汇总


    一、javascript页面刷新重载的方法:

    <a href="javascript:location.reload();">点击重新载入页面</a>
    <a href="javascript:history.go(0);">点击重新载入页面</a>
    <a href="javascript:location=location;">点击重新载入页面</a>
    <a href="javascript:location=location.href;">点击重新载入页面</a>
    <a href="javascript:location.replace(location);">点击重新载入页面</a>
    <a href="javascript:location.replace(location.href);">点击重新载入页面</a>
    <a href="javascript:location.assign(location);">点击重新载入页面</a>
    <a href="javascript:location.assign(location.href);">点击重新载入页面</a>
    <!--// 以下只支持ie -->
    <a href="javascript:document.URL=location.href;">点击重新载入页面</a>
    <a href="javascript:navigate(location);">点击重新载入页面</a>
    <a href="javascript:document.execCommand('Refresh');">点击重新载入页面</a>
    <!--// 以上只支持ie -->
    

    二、html链接重新载入方法

    <!--// 以下不支持ie -->
    <a href="">点击重新载入页面</a>
    <!--// 以上不支持ie -->
    <a href="页面本身">点击重新载入页面</a>
    

    三、自动刷新页面的方法

    <meta http-equiv="refresh" content="20">  //代码放在head中,每隔20秒钟刷新一次
    
    <meta http-equiv="refresh" content="20;url=http://www.haorooms.com">  //20秒之后页面跳转到haorooms中,通常运用到404页面
    
    //js自动刷新
    function myrefresh()
    
    {
    
           window.location.reload();
    
    }
    
    setTimeout('myrefresh()',1000); //指定1秒刷新一次
    

     四、返回上一页或下一页

    <meta http-equiv="refresh" content="20">  //代码放在head中,每隔20秒钟刷新一次
    
    <meta http-equiv="refresh" content="20;url=http://www.haorooms.com">  //20秒之后页面跳转到haorooms中,通常运用到404页面
    
    //js自动刷新
    function myrefresh()
    
    {
    
           window.location.reload();
    
    }
    
    setTimeout('myrefresh()',1000); //指定1秒刷新一次
    

    关注微信小程序  

    这些年,我们经历了多轮的淘汰赛,每轮淘汰赛都面临不同的对手,但每轮淘汰赛中我们都发展了.
  • 相关阅读:
    这是阿里技术专家对 SRE 和稳定性保障的理解
    阿里四年技术 TL 的得失总结:如何做好技术 Team Leader
    深度 | 阿里云蒋江伟:什么是真正的云原生?
    亲历者说 | 完整记录一年多考拉海购的云原生之路
    Seata RPC 模块的重构之路
    对容器镜像的思考和讨论
    20 行代码:Serverless 架构下用 Python 轻松搞定图像分类和预测
    怎么提升写代码的能力
    云原生 DevOps 的 5 步升级路径
    dubbo-go 白话文 | 从零搭建 dubbogo 和 dubbo 的简单用例
  • 原文地址:https://www.cnblogs.com/future-zmq/p/7490604.html
Copyright © 2020-2023  润新知