It doesn't happen all the time, but when it does, it breaks my app. Every so often I will do something like (I use Modernizr):
Modernizr.load({
// has object been loaded somewhere?
test: !!Namespace.ObjectToLoad
// if not, load this file
, nope: locationOfFile
// if it exists already or when done loading, run this function
, complete: function() {
var myObj = new Namespace.ObjectToLoad.init(); // <---- error: undefined is not a function
}
});
I can't use this library if I can't rely on complete() firing consistently, which sucks, because I use it for everything.
It doesn't happen all the time, but when it does, it breaks my app. Every so often I will do something like (I use Modernizr):
I can't use this library if I can't rely on
complete()
firing consistently, which sucks, because I use it for everything.