Skip to content

Instantly share code, notes, and snippets.

@chiehwen
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chiehwen/1b930bf5be633e5528a9 to your computer and use it in GitHub Desktop.
Save chiehwen/1b930bf5be633e5528a9 to your computer and use it in GitHub Desktop.
自動重載頁面
<!DOCTYPE html>
<html>
<head>
<title>自動重載頁面</title>
<meta http-equiv="Content-Type" content="text/html"; charset="UTF-8"/>
<!-- <meta http-equiv="refresh" content="2"> 加入這行 meta 可以達到同樣的功能,2 指的是每隔 2 秒重載一次頁面-->
<script type="text/javascript" src="./scripts/main.js"></script>
</head>
<body>
<p>網頁重載中...</p>
</body>
</html>
'use strict';
function fresh() {
window.location.reload();
};
setTimeout(fresh(), 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment