Skip to content

Instantly share code, notes, and snippets.

@AWaselnuk
Created November 25, 2014 16:31
Show Gist options
  • Save AWaselnuk/735c12aca5bdd7573479 to your computer and use it in GitHub Desktop.
Save AWaselnuk/735c12aca5bdd7573479 to your computer and use it in GitHub Desktop.
Wait for dependencies to arrive before executing code
// From: http://stackoverflow.com/questions/16425520/angularjs-test-that-an-external-script-is-effectively-loaded
(function waiter(){
if(!window.jQuery){ return setTimeout(waiter, 37); }
$("#myDiv").fadeOut();
}())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment