Somehow I always receive this error:
Uncaught ReferenceError: jQuery is not defined
I have the impression that jQuery (loaded via CDN) takes more time to load (confirmed by the network tab on Chrome). I run this locally on my PC, so that's why the CDN call will always be longer then the libraries. But isn't requirejs supposed to wait after jQuery is loaded before loading the other libraries?
My boot.js :
(function(){
requirejs.config({
baseUrl: '/assets/js/',
paths: {
'lib': 'lib/',
'src': 'src/',
'jquery': [
'//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min',
'lib/jquery-1.9.1.min'
],
'mootools': 'lib/mootools-core-1.4.5',
'class.mutators': 'lib/Class.Mutators.jQuery'
//'order': 'assets/js/lib/order',
},
shim: {
'class.mutators': {
deps: [
'mootools'
],
exports: 'classmutators'
},
'underscore': {
exports: '_'
}
},
waitSeconds: 15
});
requirejs([
'jquery',
'src/app-require'
], function($){
$(document).ready(function(){
var App = new $.App($('body'));
});
});
})();
My app-require.js :
define([
'mootools',
'class.mutators',
'src/Tracker',
'lib/jquery.easing.1.3',
'lib/nivo/jquery.nivo.slider.pack',
'lib/isotope/jquery.isotope.min',
'lib/waypoints.min'
], function() {
var className = 'App';
//--
return $[className] = new Class({
jQuery: className,
Implements: [Options, Events],
options: {},
//-- init
//---------------------------------------------
initialize: function(el, options) {
...
},
...
});
});
Any ideas?
Uncaught ReferenceError: jQuery is not definedoriginating from, can you see that in your console ? - Willem D'Haeseleer