Skip to content

Instantly share code, notes, and snippets.

@lambdamusic
Last active April 4, 2024 22:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lambdamusic/4734329 to your computer and use it in GitHub Desktop.
Save lambdamusic/4734329 to your computer and use it in GitHub Desktop.
JavaScript: Forcee a page to reload #js
// This will forcefully reload the current page. No jQuery needed here.
location.reload(true);
// If your content might be cached by proxy servers and your URL has no query string, try this:
location.replace(
location.href.replace(/\?.*$/, '') + '?' + Math.random());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment