3 ms·
I would love to be able to require() jQuery features: require(['jQuery.ajax', 'jQuery.events'], function() { // code using ajax and events here
by fooyc 15y ago
I would love to be able to require() jQuery features:
require(['jQuery.ajax', 'jQuery.events'], function() {
// code using ajax and events here
});
Much easier than to manage script tags.
(hint: CommonJS / AMD)
- xal 15y agoThe problem with that is that plain script tags can be started to load once the first TCP package of the HTML source code has been received. Your javascript tag would only be executed after all that has been loaded and the JS parser has been initialized. That can be up to 300ms to 500ms on slow and mobile devices.
- busticated 15y agoRequireJS has an optimizer which concats and minifies - problem solved!
- dpe82 15y agoOf course nobody likes Yahoo, but this is one of the really great features of YUI.