How to reload a page using JavaScript

前端 未结 19 2886
隐瞒了意图╮
隐瞒了意图╮ 2020-11-22 00:46

How can I reload the page using JavaScript?

I need a method that works in all browsers.

19条回答
  •  一个人的身影
    2020-11-22 01:24

    You can simply use

    window.location=document.URL
    

    where document.URL gets the current page URL and window.location reloads it.

提交回复
热议问题