score:2

Accepted answer

You need to config YUI, so he knows where to find it.

By default the loader will look for the scripts at the same place that the yui seed file. To change the place a specific script (d3) will be download you need to define a group.

A group has 'base' that is the base path where its modules will be downloaded.

So you define a group "d3" with a module d3.

YUI({
groups: {
  "d3lib": {
    base: "http://d3js.org/",  //the modules of this group will be downloaded from there
    modules: {
      "d3": {
        path:"d3.v2.js"   // base + path = http://d3js.org/d3.v2.js
      },
      "d3fake": {  //another module of the "d3lib" group
        path:"d3fake.js"  
      }
    }
  }
 }
}).use("d3", function (Y) {
   //d3 is available and ready to use!
  }
});

You can check the following link where they load some yui2 modules (this is the same principle). http://yuilibrary.com/yui/docs/yui/loader.html#example-config


Related Query