How to reload a page using JavaScript

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

    If you put

    window.location.reload(true);
    

    at the beginning of your page with no other condition qualifying why that code runs, the page will load and then continue to reload itself until you close your browser.

提交回复
热议问题