Home >Web Front-end >JS Tutorial >Share the method of refreshing the web page using js
Every website needs to have the function of refreshing the page. This article mainly shares with you the method of refreshing the webpage in js. I hope it can help everyone.
1. The page refreshes automatically: add the following code In the area
##
<meta http-equiv="refresh" content="20"> //其中20指每隔20秒刷新一次页面.
2,页面自动跳转:把如下代码加入<head>区域中
<br>
<meta http-equiv="refresh" content="20;url=http://www.jb51.net">
, 20 fingers will jump to http://www.jb51.net after 20 seconds. Page<br>
3,页面自动刷新js版
<script language="JavaScript">function myrefresh() { window.location.reload(); } setTimeout('myrefresh()',1000); //指定1秒刷新一次</script>Related recommendations:
How to refresh web pages using JavaScript_Basic knowledge
The above is the detailed content of Share the method of refreshing the web page using js. For more information, please follow other related articles on the PHP Chinese website!