Bobj-C
Bobj-C

Reputation: 5426

how to make a refresh button using javascript

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

Thanks

Upvotes: 8

Views: 43163

Answers (3)

Mohammed
Mohammed

Reputation: 21

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>

Upvotes: 2

Michael Blake
Michael Blake

Reputation: 2168

google? : javascript refresh

<!-- Codes by Quackit.com -->
<a href="javascript:location.reload(true)">Refresh this page</a>

Upvotes: 20

Gary Chambers
Gary Chambers

Reputation: 25868

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

Upvotes: 13

Related Questions