This article mainly introduces relevant information about the examples of Javascript refreshing the page. I hope this article can help everyone. Friends in need can refer to the following
Instances of Javascript refreshing the page
Several ways to refresh the page using Javascript:
1 history.go(0)
2 location.reload()
3 location= location
4 location.assign(location)
5 document.execCommand('Refresh')
6 window.navigate(location)
7 location.replace(location)
8 document.URL =location.href
Methods to automatically refresh the page:
1. Automatically refresh the page: Add the following code to the
area<meta http-equiv="refresh" content="20">
The 20 refers to refreshing the page every 20 seconds.
2. The page automatically jumps: add the following code to the
area<meta http-equiv="refresh" content="20;url=http://www.wyxg.com">
The 20th finger will jump to the http://www.wyxg.com page after 20 seconds.
3. The page refreshes automatically js version
<mce:script language="JavaScript"><!-- function myrefresh() { window.location.reload(); } setTimeout('myrefresh()',1000); //指定1秒刷新一次 // --></mce:script>
The above is the detailed content of Detailed example of refreshing the page in Javascript. For more information, please follow other related articles on the PHP Chinese website!