window.location.reload()
is supported in all browsers, according to w3schools
But what's with window.location.reload(true)
which reloads the page without cache? How well is it supported?
True reloads the page from the server (e.g. does not store the data cached by the browser): window. location. reload(true);
You can use the location. reload() JavaScript method to reload the current URL. This method functions similarly to the browser's Refresh button. The reload() method is the main method responsible for page reloading.
window. location. href method returns/loads the current url. So we can use it to reload/refresh the page in javascript.
Using location. reload() is the valid syntax. It is only the reload with forcedReload which is deprecated.
reload()
is supposed to accept an argument which tells it to do a hard reload, ie, ignoring the cache:
location.reload(true);
Note : I don`t think just saying that it is supported with FF is right, here it is clearly mentioned that it is supported by other browser as well.
Check out below links for more information
how-can-i-refresh-a-page-with-jquery
Reload without cache
Location.reload
Reload method
refresh-reload-page-using-jquery
Is Window.location.reload(true)?
Little Extra information in this question
difference-between-window-location-href-window-location-href-and-window-location
Hope this helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With