I'm using the latest version of RequireJS and trying to get it to work with jQuery and jQuery plugins.
I can get it to load jQuery fine, but I can't get it to work with jQuery plugins. This is my code:
var dependencies = ["order!jquery"];
dependencies = dependencies.concat([
"order!plugins/underscore-1.3.1",
"order!plugins/backbone-0.9.1",
"order!plugins/jquery.typewatch"]);
require.config({
waitSeconds: 30,
paths: {
"jquery": 'http://code.jquery.com/jquery-1.9.1'
}
});
require(dependencies, function($) {
...
jQuery is loading OK, but I then get
Uncaught ReferenceError: jQuery is not defined jquery.typewatch.js:92
Uncaught TypeError: undefined is not a function backbone-0.9.1.js:1064
The first error is complaining about jQuery not being defined, and the second about $ not being defined.
Why isn't this working? Everything seems to be loading in the right order, the order plugin works OK for underscore and backbone, and I can use $ in the code for normal jQuery functions.