Reputation: 55200
I had Bootstrap 3.3.6 and jQuery 1.12.4 working in my website.
As jQuery 3.0.0 was released into production, I upgraded jQuery to jQuery-3.0.0.js. After that, when I ran my site I got this console error.
Error: Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3
Tried adding jQuery Migrate 3.0.0 plugin, but it didn't work too.
The error still persists and Bootstrap's JavaScript won't work. Is there a work around? Or do one have to wait till the next release of bootstrap?
Found this in Bootstrap source.
+function ($) {
'use strict';
var version = $.fn.jquery.split(' ')[0].split('.')
if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 2)) {
throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3')
}
}(jQuery);
Does this mean that one have to wait for a later version?
Upvotes: 6
Views: 7468
Reputation: 320
Adding the following to the top of the bootstrap.min.js file and tweaking the isFunction condition worked for me.
function isFunction(func){
return typeof func === "function";
}
And then, still in bootstrap.min.js, find:
a.isFunction
and replace with:
isFunction
Upvotes: 2