Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Browser support for window.location.reload(true)

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?

like image 991
Adam Halasz Avatar asked Jun 04 '12 04:06

Adam Halasz


People also ask

What is window location reload true?

True reloads the page from the server (e.g. does not store the data cached by the browser): window. location. reload(true);

Can I use window location reload?

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.

Does window location href reload the page?

window. location. href method returns/loads the current url. So we can use it to reload/refresh the page in javascript.

Is window location reload deprecated?

Using location. reload() is the valid syntax. It is only the reload with forcedReload which is deprecated.


1 Answers

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

like image 108
Hitesh Avatar answered Sep 30 '22 05:09

Hitesh