Button that refreshes the page when clicked

I need a button that will refresh the page on user click. I tried this:

<input type="button" value="Reload Page" onClick="reload"> 

or

 <input type="button" value="Refresh Page" onClick="refresh"> 

But not one worked.

+89
javascript refresh reload button
Apr 26 '15 at 23:05
source share
10 answers

Use onClick with window.location.reload() , onClick .:

 <button value="Refresh Page" onClick="window.location.reload();"> 

Or history.go(0) , i.e.

 <button value="Refresh Page" onClick="history.go(0);"> 

Or window.location.href=window.location.href for a full reboot, that is:

 <button value="Refresh Page" onClick="window.location.href=window.location.href"> 
+192
Apr 26 '15 at 23:08
source share

It works for me

HTML

  <button type="submit" onClick="refreshPage()">Refresh Button</button> 

Javascript

 <script> function refreshPage(){ window.location.reload(); } </script> 
+9
May 14 '18 at 6:32
source share
 <a onClick="window.location.reload()">Refresh</a> 

This is really great for me.

+3
Aug 28 '17 at 18:06 on
source share

Only this page with a real reload (today)

 <input type="button" value="Refresh Page" onClick="location.href=location.href"> 

Others do not exactly restart. They store values ​​inside text fields.

+3
04 Oct '17 at 4:37 on
source share
 <button onclick=location=URL>Refresh</button> 

It may sound funny, but it really is a trick.

+2
Jun 26 '17 at 18:30
source share

button that refreshes the page when clicked

Use the onClick button with window.location.reload ():

 <button onClick="window.location.reload();"> 
+2
Jul 05 '19 at 7:57
source share

just create an empty link to the link, for example the following

  <a href="" onclick="dummy(0);return false;" > 
+1
Mar 10 '17 at 22:03
source share

Use it so that I can reload the same page:

OnClick = 'window.location.reload ()'

-one
25 Oct '18 at 5:37
source share

If you are looking for a form reset:

 <input type="reset" value="Reset Form Values"/> 

or reset other aspects of the form not processed by the browser

 <input type="reset" onclick="doFormReset();" value="Reset Form Values"/> 

Using jQuery

 function doFormReset(){ $(".invalid").removeClass("invalid"); } 
-one
Dec 22 '18 at 18:54
source share
 window.opener.location.href ='workItem.adm?wiId='+${param.wiId}; 

It will go to the desired path and you will not receive an invitation to resend.

-5
Sep 03 '17 at 14:05
source share



All Articles