8

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

Thanks

Bobj-C
  • 5,276
  • 9
  • 47
  • 83

3 Answers3

20

google? : javascript refresh

<!-- Codes by Quackit.com -->
<a href="javascript:location.reload(true)">Refresh this page</a>
Michael Blake
  • 2,068
  • 2
  • 18
  • 31
13

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

Gary Chambers
  • 24,930
  • 4
  • 35
  • 31
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>
Mohammed
  • 21
  • 2