jQuery ajax Page Reload

前端 未结 4 1116
我寻月下人不归
我寻月下人不归 2020-12-18 11:44

We are making multiple ajax requests to \"save\" data in a web app, then reload the page. We have run into a situation where (since requests are made asynchronously) the pa

4条回答
  •  爱一瞬间的悲伤
    2020-12-18 12:25

    I haven't seen it mentioned here, so I will add this:

    If your content doesn't seem to refresh when using an ajax call with document.location.reload(), then add true as a parameter to the reload function - that will tell it to not use the cached version of the page, but rather to force a fresh call to the server.

    So, the script to reload the page should look like this:

    document.location.reload(true);

提交回复
热议问题