Skip to content

Instantly share code, notes, and snippets.

@rmurphey
Created August 2, 2009 20:27
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 rmurphey/160201 to your computer and use it in GitHub Desktop.
Save rmurphey/160201 to your computer and use it in GitHub Desktop.
/**
* a file that can be safely reloaded multiple times in the same page view,
* allowing some stuff to run once and some stuff to run every time the
* page is loaded
*/
var myInitiallyFalseThing = false || myInitiallyFalseThing;
(function() {
if (!myInitiallyFalseThing) {
// do stuff that should only happen once
myInitiallyFalseThing = true;
}
// do other stuff
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment