How can I force [removed] to make an HTTP request instead of using the cache?

后端 未结 5 1774
难免孤独
难免孤独 2021-01-11 17:18

In my web application I am setting window.location to navigate to a different page, but for some reason Firefox shows an old version of that page.

Usin

5条回答
  •  情书的邮戳
    2021-01-11 18:17

    Add some time specific or random querystring value to the url. This will force the page to be reloaded.

    var yourNewLoc = "http://newlocation.com/";
    document.location = yourNewLoc + "?c=" + (new Date()).valueOf();
    

提交回复
热议问题