There are many posts about how to fallback a JQuery CDN to a local copy by checking the existance of the global variable JQuery.
My question is , how to do the same to twitter-bootstrap ? Is there a variable defined in bootstrap so that I can check to make sure the CDN is available ?
BTW, I use netdna.bootstrapcdn.com as my bootstrap CDN
This is what I did and it works fine
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script> <script> $.fn.modal || document.write('<script src="Script/bootstrap.min.js">\x3C/script>')</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With