Skip to content

Instantly share code, notes, and snippets.

@mort3za
Last active April 10, 2018 02:23
Show Gist options
  • Save mort3za/845f06cf3d3724d36e16 to your computer and use it in GitHub Desktop.
Save mort3za/845f06cf3d3724d36e16 to your computer and use it in GitHub Desktop.
Loading jQuery and AngularJS from CDN with local fallback
<script src='http://code.jquery.com/jquery-latest.min.js' type='text/javascript'></script>
<script src='//ajax.googleapis.com/ajax/libs/angularjs/1.2.25/angular.min.js' type='text/javascript'></script>
<script type="text/javascript">
// Fallbacks
window.jQuery || document.write(unescape("%3Cscript src='js/vendor/jquery.min.js' type='text/javascript'%3E%3C/script%3E"));
window.angular || document.write(unescape("%3Cscript src='js/vendor/angular.min.js' type='text/javascript'%3E%3C/script%3E"));
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment