Namespace: Navigation:reload

Navigation:reload

Methods

reload(cachedopt, nullable, postUsableopt, nullable)

Reloads the current window-location. Differentiates between cached and cache-refreshing reload. Hint: the forcedReload param in window.location.reload is deprecated and not supported anymore in all browsers, so, in order to do a cache busting reload we have to use a trick, by using a POST-reload, since POST never gets cached. If, for some reason, you cannot POST to a URL, I also provided a second, less effective fallback, using "replace".

Hint: depending on your browser a cached reload may keep the current scrolling position in the document, while the uncached variants won't

Parameters:
Name Type Attributes Default Description
cached Boolean <optional>
<nullable>
true

should we use the cache on reload?

postUsable Boolean <optional>
<nullable>
true

if set to false, we try to replace URL instead of POSTing to it

Source:
Example
// with cache
reload();
// without cache via POST
reload(false);
// without cache via "replace"
reload(false, false);