how to make a refresh button using javascript
Asked Answered
C

3

8

Can I make a function to refresh the page using JavaScript (same browser refresh button)

Thanks

Cubeb answered 10/4, 2011 at 10:19 Comment(0)
C
13

You can do this by using: window.location.reload()

Collusive answered 10/4, 2011 at 10:21 Comment(0)
A
20

google? : javascript refresh

<!-- Codes by Quackit.com -->
<a href="javascript:location.reload(true)">Refresh this page</a>
Angioma answered 10/4, 2011 at 10:22 Comment(0)
C
13

You can do this by using: window.location.reload()

Collusive answered 10/4, 2011 at 10:21 Comment(0)
P
2

I added a refresh button in a form I made.

<script>
  function refresh(){
        window.location.reload("Refresh")
      }
</script>

and then called it via button in html:

<p><input type="button" value="Refresh" onClick="refresh(this)"></p>
Pennington answered 2/8, 2020 at 6:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.