刷新页面一次

时间:2020-08-17 17:23:08

标签: html

每21秒刷新一次页面。我需要它只发生一次。该怎么办?

<head>
<meta http-equiv="refresh" content="21;url=index.html">
</head>

1 个答案:

答案 0 :(得分:0)

请勿为此进行meta刷新。

在JavaScript中设置一个计时器,该计时器在2100毫秒后执行回调函数:

setTimeout(function(){ location.reload(); }, 2100);