How can I refresh a page with jQuery?

后端 未结 28 2480
刺人心
刺人心 2020-11-22 07:00

How can I refresh a page with jQuery?

28条回答
  •  情歌与酒
    2020-11-22 07:15

    If the current page was loaded by a POST request, you may want to use

    window.location = window.location.pathname;
    

    instead of

    window.location.reload();
    

    because window.location.reload() will prompt for confirmation if called on a page that was loaded by a POST request.

提交回复
热议问题