Skip to content

Instantly share code, notes, and snippets.

@mojaray2k
Created March 6, 2013 06:15
Show Gist options
  • Save mojaray2k/5097131 to your computer and use it in GitHub Desktop.
Save mojaray2k/5097131 to your computer and use it in GitHub Desktop.
This is a fallback Script for Bootstrap CDN
//bootstrapfallback.js
//<!-- BOOTSTRAP JS WITH LOCAL FALLBACK-->
//<script type="text/javascript" src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/js/bootstrap.min.js"></script>
//<script> if(typeof($.fn.modal) === 'undefined') {document.write('<script src="//www.mysite.com/js/v/bootstrap-2.1.1.js"><\/script>')}</script>
//<!-- BOOTSTRAP CDN FALLBACK CSS-->
//<script>$(document).ready(function() {
var bodyColor = $('body').css("color"); if(bodyColor != 'rgb(51, 51, 51)') {$("head").prepend("<link rel='stylesheet' href='//www.mysite.com/css/fw/bootstrap-combined-2.1.1.css' type='text/css' media='screen'>");}
//});</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment