Last active
January 16, 2016 02:05
-
-
Save oquirozm/f08693c7d308c9f20b18 to your computer and use it in GitHub Desktop.
Bootstrap + jQuery CDN-Local Fallback
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
<head> | |
<!-- Bootstrap CSS CDN --> | |
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> | |
</head> | |
<body> | |
<!-- APP CONTENT --> | |
<!-- jQuery CDN --> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script> | |
<!-- jQuery local fallback --> | |
<script>window.jQuery || document.write('<script src="/local/jquery.min.js"><\/script>')</script> | |
<!-- Bootstrap JS CDN --> | |
<script src="//netdna.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> | |
<!-- Bootstrap JS local fallback --> | |
<script>if(typeof($.fn.modal) === 'undefined') {document.write('<script src="/local/bootstrap.min.js"><\/script>')}</script> | |
<!-- Bootstrap CSS local fallback --> | |
<script> | |
$(document).ready(function() { | |
var bodyColor = $('body').css('color'); | |
if(bodyColor != 'rgb(51, 51, 51)') { | |
$("head").prepend('<link rel="stylesheet" href="/local/bootstrap.min.css">');}}); | |
</script> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment