使用html或javascript实现F5键

Implement F5 key using html or javascript

本文关键字:F5 实现 javascript html 使用      更新时间:2023-09-26

我试过下面这段代码:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-     revalidate">
<meta http-eq`enter code here`uiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0"> 
<meta http-equiv="Last-Modified" content="Sun, 26 Jul 2015 23:12:00 GMT"> 
<meta http-equiv="refresh" content="10"> 
</head>
<body>
<h1>This is a Headi</h1>
<p>This is a paragraph.</p>
</body>
</html>

并且还尝试了location.reload(true)代码的实现,两者都不能在我的情况下工作,即他们正在努力重新加载页面,但实际上没有刷新它。输出最初打印主体,但10秒后是一个空白页:(

我想通过脚本实现F5的功能,而不是重新加载

您必须在content中的"10"后面添加URL:

<meta http-equiv="refresh" content="10; URL=http://www.example.com/index.html">