I've been looking at the CSS & JavaScript from Bootstrap 3. Nothing is modularized under a common alias. For the JavaScript, it is injected into jQuery's prototype...
How would it be possible to detect which version of Bootstrap is included in a user's web page from a third party plugin/library point of view with JavaScript?
Bootstrap uses jQuery for JavaScript plugins (like modals, tooltips, etc). However, if you just use the CSS part of Bootstrap, you don't need jQuery.
Bootstrap is an HTML, JavaScript framework that you can use as basis for creating web sites or web applications.
Bootstrap 5 is designed to be used without jQuery, but it's still possible to use our components with jQuery. If Bootstrap detects jQuery in the window object it'll add all of our components in jQuery's plugin system; this means you'll be able to do $('[data-bs-toggle="tooltip"]').
The version of each of Bootstrap's jQuery plugins can be accessed via the VERSION property of the plugin's constructor
$.fn.tooltip.Constructor.VERSION
As suggested in comments, the only function
that seems to be removed in Bootstrap 3 was typehead
, even then - there doesn't seem to be a reliable way of detecting which Bootstrap version the site has loaded.
var bsVersion = ( typeof $.fn.typeahead !== 'undefined' ? '2.3.2' : '3.0.0' );
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