This article mainly introduces the use of JavaScript to refresh the Web page, is JS is commonly used to achieve one of the most basic functions, the need for friends can refer to the
You can use the JavaScript Location.reload method to refresh a Web page. When the user clicks on a link this code can be invoked automatically in an event.
If you want to use the mouse to click to refresh the page, you can use the following code:
?
1 |
<a href= "Javascript:location.reload (True)" >refresh page</a> |
To get a better idea of it, you can refresh the page
Automatic refresh:
You can also refresh the page by automatically using JavaScript for a given time period. The following is an example of refreshing this page every 5 seconds. Can change this time according to your request.
?
1 2 3 4 5 6 7 8 9 10 11 12 13-14 |
|
The settimeout () here is a built-in JavaScript function that can be used to execute another function after a given time interval.