Button that refreshes the page on click

允我心安 提交于 2019-11-27 18:03:59

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

<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 'full' reload, i.e.:

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

This works for me

HTML

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

JavaScript

<script>
function refreshPage(){
    window.location.reload();
} 
</script>

Only this realy reloads page (Today)

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

Others do not exactly reload. They keep values inside text boxes.

<a onClick="window.location.reload()">Refresh</a>

This really works perfect for me.

<button onclick=location=URL>Refresh</button>

This might look funny but it really does the trick.

button that refresh the page on click

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

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

just create the empty reference on link such as following

 <a href="" onclick="dummy(0);return false;" >

Use this its work fine for me to reload the same page:

onClick='window.location.reload()'

If you are looking for a form reset:

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

or to reset other aspects of the form not handled by the browser

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

Using jQuery

function doFormReset(){
    $(".invalid").removeClass("invalid");
}
Malatesh
window.opener.location.href ='workItem.adm?wiId='+${param.wiId};

It will go to the required path and you won't get any resend prompt.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!