I think I'm wrong. This is what I am trying to do, instead of using RequireJS or LABjs:
var APP = {}; APP._timers = {}; APP._timelines = {}; $.when( $.getScript('/app/models/Timer.js'), $.getScript('/app/models/Section.js'), $.getScript('/app/collections/Timers.js'), $.getScript('/app/collections/Sections.js'), $.getScript('/app/views/SectionView.js'), $.getScript('/app/views/APPView.js'), $.Deferred(function(deferred){ $(deferred.resolve); }) ).done(function () { alert('done'); console.log(APP.APPView); var foo = new APP.APPView; APP._timelines.main = new APP.Timers('main'); APP._timelines.branched = new APP.Timers('branched'); }).fail(function(){ alert('failed'); });
It warns failed , nothing is written to the console.
If I open any of these files, say APPView.js and warn something at the top or bottom of the file, I see that it is displayed. Here is an example of this file:
APP.APPView = Backbone.View.extend({ el : $("#app-view"), initialize : function () { alert('App view initialized');
source share