1

I'm using require-jquery.js and I'm trying to load the jsscrollpane plugin in my application.

I have this configuration in my index.html page (It's a single page application):

require( { paths: {
            'ca': 'cafe/ca',
            'casp': 'sp/sp',
            'ko': 'cafe/lib/knockout/knockout',
            'komap': 'cafe/lib/knockout/knockout.mapping',
            'kopost': 'cafe/lib/knockout/knockout-postbox',
            'jd': 'cafe/lib/jaydata/jaydata',
            'jdKo': 'cafe/lib/jaydata/jaydatamodules/knockout',
            'jdDeferred': 'cafe/lib/jaydata/jaydatamodules/deferred',
            'jqscroll': 'cafe/lib/jsscrollpane/jquery.jscrollpane.min'
        },
        waitSeconds: 60,
        shim: {
            'jd': { exports: '$data', deps: [ 'cafe/lib/jaydata/datajs-1.0.3' ] },
            'jdDeferred': { exports: '$data', deps: [ 'jd' ] },
            'jqscroll': ['jquery']
        }
         ..............

Then i try to call the plugin from a module:

define( [ 'jquery', 'ko','jqscroll' ], function( $, ko ,jqscroll) {
     console.log(jqscroll);
}

But I keep getting undefined, what am I doing wrong?

3
  • require(["jquery", "jquery.alpha", "jquery.beta"], function($) { //the jquery.alpha.js and jquery.beta.js plugins have been loaded. $(function() { $('body').alpha().beta(); }); }); Commented Feb 28, 2013 at 15:55
  • Oh, how stupid of me, it's been along long day :), plesae post it as an answer so i can accept it. Commented Feb 28, 2013 at 15:57
  • Jaydata does not support requirejs yet but it is on our roadmap Commented Feb 28, 2013 at 17:33

1 Answer 1

2

I think this helps.

require(["jquery", "jquery.alpha", "jquery.beta"], function($) {
    //the jquery.alpha.js and jquery.beta.js plugins have been loaded.
    $(function() {
        $('body').alpha().beta();
    });
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.