JS / jQuery 刷新页面的方法

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <!-- 引入jQuery -->
    <script src="jq.js"></script>
</head>

<body>
        <!-- 刷新按钮 -->
        <button id="btn1">刷新</button>

        <script>
            $('#btn1').click(function(){

                // 刷新页面 方法1:
                window.location.reload();

                // 刷新页面 方法2:
                location.reload();

            });
        </script>
</body>
</html>

  

posted @ 2023-05-16 14:04  映辉  阅读(79)  评论(0)    收藏  举报