How to reload a page using JavaScript

前端 未结 19 2625
隐瞒了意图╮
隐瞒了意图╮ 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.

    0 讨论(0)
提交回复
热议问题