When you create a web page, do you sometimes want your web page to automatically refresh continuously, or automatically jump to another page you set after a period of time?
In fact, it is very simple to achieve this effect, and this effect cannot even be called a special effect. You just need to add the following code to your web page.
1. Automatically refresh the page: add the following code to the
<meta http-equiv="refresh" content="20">,其中20指每隔20秒刷新一次页面.
2. Automatically jump the page: add the following code to the
area<meta http-equiv="refresh" content="20;url=http://www.php.cn">,其中20指隔20秒后跳转到http://www.php.cn页面
3. The page automatically refreshes js version
<script language="JavaScript"> function myrefresh(){ window.location.reload(); } setTimeout('myrefresh()',1000); //指定1秒刷新一次 </script>
The above is the detailed content of How to automatically refresh the web page? 3 codes for automatic page refresh. For more information, please follow other related articles on the PHP Chinese website!