Home > Web Front-end > JS Tutorial > Share the method of refreshing the web page using js

Share the method of refreshing the web page using js

小云云
Release: 2018-03-19 17:14:39
Original
1692 people have browsed it

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秒刷新一次页面.
Copy after login
2,页面自动跳转:把如下代码加入<head>区域中
Copy after login
<br>
Copy after login
<meta http-equiv="refresh" content="20;url=http://www.jb51.net">
Copy after login

, 20 fingers will jump to http://www.jb51.net after 20 seconds. Page<br>

3,页面自动刷新js版
Copy after login
<script language="JavaScript">function myrefresh()
{
   window.location.reload();
}
setTimeout('myrefresh()',1000); //指定1秒刷新一次</script>
Copy after login
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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template