Skip to content

Instantly share code, notes, and snippets.

@florian-frost
Last active September 29, 2015 21:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save florian-frost/cb3ea311f91875e1dbf5 to your computer and use it in GitHub Desktop.
Save florian-frost/cb3ea311f91875e1dbf5 to your computer and use it in GitHub Desktop.
check if Bootstrap 2 or 3 is enabled
// 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