How to reload a page using JavaScript

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

    location.reload();
    

    See this MDN page for more information.

    If you are refreshing after an onclick then you'll need to return false directly after

    location.reload();
    return false;
    

提交回复
热议问题