Is the YUI Loader disposable reliable?

I am using YUI components and want to start using the Loader utility to indicate my dependencies on my page. From your experience, is YUI Loader Utility a reliable way to load Javascript dependencies on web pages?

+3
source share
3 answers

Yes, YUI Loader is reliable in all A-grade browsers. For a list of browsers Yahoo! considers A-grade, check the graphical browser support chart .

+8
source

Actually, yes. Nothing should go wrong, and of course, if that were the case, yahoo would be up to the problem as soon as possible!

+2
source

. .

:

  • - . (script )?
  • subscibeOnce, 'on module (s). , / . , - .
  • , . : [] ( ), -, . , .

- :

var TheBase = function(oConfig){
var thisBase = this;
var EVENTS = {
    ON_SCRIPTS_LOADED : "onScriptsLoaded"
    , ON_SCRIPTS_PROGRESS : "onScriptsProgress"
}
for(var eventName in EVENTS){
    thisBase.createEvent(EVENTS[eventName]);    
}
var _loader = new YAHOO.util.YUILoader({
    base: oConfig.yuiBasePath
    ,onSuccess:function(o){
        thisBase.fireEvent(EVENTS.ON_SCRIPTS_LOADED);
    }
    ,onProgress:function(o){
        thisBase.fireEvent(EVENTS.ON_SCRIPTS_PROGRESS,o.name);
    }
})
//optional
    thisBase.loader = _loader;

}

TheBase.prototype = {
subscribeOnce : function(eventName, fnc, context, args){
    var that = this;
    var handler = function hander(){
        fnc.apply(context, arguments);
        that.unsubscribe(eventName, handler);
    }
    this.subscribe(eventName, handler, args, false);
}

}

//

YAHOO.lang.augment(TheBase, YAHOO.util.EventProvider);
+1

Source: https://habr.com/ru/post/1697096/


All Articles