6
Ways To Refresh a Webpage Using Javascript
6
Ways To Refresh a Webpage
Using
Javascript
1. W
indows API
1. W
indows API
window.location.
reload
( )
2.
Document API
2.
Document API
document.location.
reload
( )
3.
Refresh Using onClick Method
3.
Refresh Using onClick Method
<button
type
=
"
button
"
onClick
=
"
window.location.reload()
">
Page Refresh on Button Click
</button>
4.
Using SetTimeout()
4.
Using SetTimeout()
setTimeout
( ( )
=>
{
document.location
.
reload
( ) ;
},
1000
)
5. H
istory API
5. H
istory API
history.
go
( )
6. M
eta Tags
6. M
eta Tags
<
meta
http-equiv
="
refresh
"
content
="
30
">
Find out more