Uncaught Error: Bootstrap's JavaScript requires jQuery with requirejs -
i getting error says jquery not defined.
bootstrap.js:8 uncaught error: bootstrap's javascript requires jquerybootstrap.js:8 (anonymous function)
bootstrap v3.3.0
jquery javascript library v2.1.3
requirejs
require.config({ shim: { 'backbone': { deps: ['underscore', 'jquery'] }, 'backbone-validation': { deps: ['backbone', 'jquery'] }, 'jquerymx': { deps: ['jquery'] }, 'bootstrap': { deps: ['jquery'] } }, paths: { 'jquery': '/public/js/lib/jquery-2.1.3', 'jquerymx': '/public/js/lib/jquerymx-3.2.custom', 'bootstrap': '/public/js/lib/bootstrap', 'handlebars': '/public/js/lib/handlebars-v2.0.0', 'underscore': '/public/js/lib/underscore', 'backbone': '/public/js/lib/backbone', 'backbone-validation': '/public/js/lib/backbone-validation' } }); require( [ 'order!jquery', 'order!jquerymx', 'order!bootstrap', 'order!handlebars', 'order!underscore', 'order!backbone', 'order!backbone-validation' ], function () { require(['main'], function (main) { main.initialize(); }); });
is there wrong here?
thanks.
a few suggestions:
first, order
plugin no longer supported or necessary in requirejs 2.0. shim
configuration capable of expressing need do. see here details.
second, i'm little confused why have both jquery
, jquery.min
listed dependencies. should provide exact same thing, jquery.min
being smaller file. js can confused when pull in same code twice, might what's happening here. try removing instances of jquery.min
configuration.
finally, two-phased require(...)
call doesn't appear necessary. assuming main
module lists libraries needs directly, should able do:
require(['main'], function (main) { main.initialize(); });
if above suggestions don't help, please provide more details -- i.e. in main
module.
Comments
Post a Comment