How to reload a page using JavaScript

前端 未结 19 2598
隐瞒了意图╮
隐瞒了意图╮ 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:49

    The reload() method is used to reload the current document.

    The reload() method does the same as the reload button in your browser.

    By default, the reload() method reloads the page from the cache, but you can force it to reload the page from the server by setting the forceGet parameter to true: location.reload(true).

            location.reload();
    

提交回复
热议问题