I\'m using requireJS to load scripts. It has this detail in the docs:
The path that is used for a module name should not include the .js extension,
requirejs' noext plugin:
Load scripts without appending ".js" extension, useful for dynamic scripts...
Documentation
check the
examplesfolder. All the info you probably need will be inside comments or on the example code itself.Basic usage
Put the plugins inside the
baseUrlfolder (usually same folder as the main.js file) or create an alias to the plugin location:require.config({ paths : { //create alias to plugins (not needed if plugins are on the baseUrl) async: 'lib/require/async', font: 'lib/require/font', goog: 'lib/require/goog', image: 'lib/require/image', json: 'lib/require/json', noext: 'lib/require/noext', mdown: 'lib/require/mdown', propertyParser : 'lib/require/propertyParser', markdownConverter : 'lib/Markdown.Converter' } }); //use plugins as if they were at baseUrl define([ 'image!awsum.jpg', 'json!data/foo.json', 'noext!js/bar.php', 'mdown!data/lorem_ipsum.md', 'async!http://maps.google.com/maps/api/js?sensor=false', 'goog!visualization,1,packages:[corechart,geochart]', 'goog!search,1', 'font!google,families:[Tangerine,Cantarell]' ], function(awsum, foo, bar, loremIpsum){ //all dependencies are loaded (including gmaps and other google apis) } );