Last active
September 29, 2015 21:03
-
-
Save florian-frost/cb3ea311f91875e1dbf5 to your computer and use it in GitHub Desktop.
check if Bootstrap 2 or 3 is enabled
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
// Bootstrap 3 | |
// Will be true if bootstrap 3 is loaded, false if bootstrap 2 or no bootstrap | |
var bootstrap3_enabled = (typeof $().emulateTransitionEnd == 'function'); | |
if (!bootstrap3_enabled) { | |
document.write('<script src="//netdna.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"><\/script>'); | |
}; | |
// Bootstrap 2-3 | |
// Will be true if bootstrap is loaded, false otherwise | |
var bootstrap_enabled = (typeof $().modal == 'function'); | |
if (!bootstrap_enabled) { | |
document.write('<script src="//netdna.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"><\/script>'); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment