How to reload a page using JavaScript

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

    Try:

    window.location.reload(true);
    

    The parameter set to 'true' reloads a fresh copy from the server. Leaving it out will serve the page from cache.

    More information can be found at MSDN and in the Mozilla documentation.

提交回复
热议问题