如何使用JavaScript刷新页面?


当前回答

在按钮标记中使用onclick=“return location.reload();”。

<button id="refersh-page" name="refersh-page" type="button" onclick="return location.reload();">Refesh Page</button>

其他回答

在按钮标记中使用onclick=“return location.reload();”。

<button id="refersh-page" name="refersh-page" type="button" onclick="return location.reload();">Refesh Page</button>

我想有很多方法会奏效:

window.location.reload();history.go(0);window.location.href=window.location.html;

use

location.reload();

or

window.location.reload();

您应该使用以下代码

window.location.reload();

这对我有用。

function reload(){
    location.reload(true);
}