Last active
August 29, 2015 14:14
-
-
Save mangreen/70a1ba06890169ab5b6d to your computer and use it in GitHub Desktop.
JavaScript: Falling back to a local version of AngularJS if the CDN version fails to load
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- attempt to load AngularJS from CDN --> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js"></script> | |
<!-- if AngularJS fails to load fallback a local version --> | |
<script>window.angular || document.write('<script src="assets/js/angular.min.js"><\/script>');</script> | |
<!-- jQuery Ver. --> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
<script type="text/javascript"> | |
window.jQuery || document.write('<script src="../components/jquery/dist/jquery.min.js"><\/script>') | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment