What’s the proper way to wait for classes loaded asynchronously before calling on them?
Note: I’m in a complicated situation where I can’t use the async load callback.
Is this the best way to do it?
callClassFunction : function () {
try {
waitingOnThisClass.someFunction();
} catch (e) {
setTimeout("superClass.callClassFunction()",250);
}
}
*jQuery ways are worth mentioning if there are any…
Well. if jQuery is allowed -jquery promise interface and jQuery.Deferred is just the thing:
Another example;