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

Share the method of refreshing the web page using js

小云云
小云云Original
2018-03-19 17:14:391669browse

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!

Statement:
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