• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 516
  • Last Modified:

simple refresh command via button on html page

I have a web page that opens at size 500, 500, so there are no buttons.

CTRL-R works for refresh, but I want a button to execute refresh, how do I do this ?
0
Alaska Cowboy
Asked:
Alaska Cowboy
  • 2
2 Solutions
 
Gurvinder Pal SinghCommented:
try any of these
<input type=button value="Refresh" onClick="history.go()">
<input type="button" value="Reload Page" onClick="window.location.reload()">
<input type="button" value="Reload Page" onClick="window.location.href=window.location.href">
0
 
infochandruCommented:
Hope this will helps you

<html>
<head>
<script type="text/javascript">
function reloadPage()
  {
  window.location.reload()
  }
</script>
</head>
<body>
<input type="text" >
<input type="button" value="Reload page"
onclick="reloadPage()" />

</body>
</html>
<html>
<head>
<script type="text/javascript">
function reloadPage()
  {
  window.location.reload()
  }
</script>
</head>
<body>
<input type="text" >
<input type="button" value="Reload page"
onclick="reloadPage()" />

</body>
</html>

Open in new window

0
 
Alaska CowboyAuthor Commented:
thank you both, will try it out now.
0
 
Alaska CowboyAuthor Commented:
worked ! thanks a lot.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now