单击后刷新页面的按钮 [英] Button that refreshes the page on click
本文介绍了单击后刷新页面的按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要一个按钮,该按钮将在用户单击时刷新页面。
我尝试过此操作:
I need a button that will refresh the page on the user's click. I tried this:
<input type="button" value="Reload Page" onClick="reload">
或
<input type="button" value="Refresh Page" onClick="refresh">
但两者都不起作用。
推荐答案
在 window.location中使用
,即: onClick
.reload()
Use onClick
with window.location.reload()
, i.e. :
<button onClick="window.location.reload();">Refresh Page</button>
或 history.go(0)
,即:
<button onClick="history.go(0);">Refresh Page</button>
或 window.location.href = window.location.href
重新加载 完全,即:
<button onClick="window.location.href=window.location.href">Refresh Page</button>
这篇关于单击后刷新页面的按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文