I had BackboneJs + jquery code, which I am now trying to modulate with requireJs. In my code I use additional jquery plugins like nanoscroller etc.
Previously, you just need to call the script:
<script type="text/javascript" src="../javascript/jquery.nanoscroller.js"></script>
Now I am trying to call the script by:
define([ 'jQuery', 'Underscore', 'Backbone', 'text!templates/landingTemplate.html', 'library/jquery/jquery.nanoscroller.js' ], function($, _, Backbone, LandingTemplate){ var LandingView = Backbone.View.extend({
But I get the following error:
Error: jQuery is not defined Source File: http://localhost:8080/sample/Main%20App/Backbone%20+%20Require.js%20Impl/js/library/jquery/jquery.nanoscroller.js
I tried a couple of things: Using "require" instead of "define", but that didn't work. I'm not sure what I am missing here. Please help.
Thanks, Komal.
source share