Full Refresh of page - Ctrl+F5

血红的双手。 提交于 2021-02-07 02:57:44

问题


I would like to know how to implement a "ctrl+f5" command into my HTML page. I can use javascript or html.

It should be run only when people click in a link.

Thanks, Alex


回答1:


You should be able to use this javascript to suite your need:

onClick="window.location.reload(true)"

window.location.reload(true) has been deprecated. You can use:

window.location.href = window.location.href




回答2:


Something like this?

<a href="document.location.reload(true);document.location='/mylink'">Click here to refresh the page</a>



回答3:


you can create a button for refresh , add the following code into your html page

<a href="JavaScript: location.reload(true);">Refresh page</a>



来源:https://stackoverflow.com/questions/22841312/full-refresh-of-page-ctrlf5

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