Skip to content

Instantly share code, notes, and snippets.

@kentcdodds
Last active December 19, 2015 10:29
Show Gist options
  • Save kentcdodds/5941149 to your computer and use it in GitHub Desktop.
Save kentcdodds/5941149 to your computer and use it in GitHub Desktop.
How to check whether an external resource loaded and load a local copy if it failed to load. See README.md

Double Take Script Loader

This has been moved to an official Git repository

@kentcdodds
Copy link
Author

@klamping, thanks for the feedback. I'll look into the timeout concept a little. But I believe that the browser waits for each script to load/fail before moving on to parsing the rest of the document (hence the "best practice" of including scripts at the bottom of your page right before the tag).

@kentcdodds
Copy link
Author

Note to self Figure out a way to add an option for libraries that attach themselves to the namespace of other global variables (like jQuery plugins or AngularJS modules).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment