Open emanwebdev opened 10 years ago
nice..only a couple of fixes needed. I like the on demand part ;-)
Quoted from https://github.com/rgrove/lazyload#caveats
All browsers support parallel loading of CSS. However, only (to be updated with nowadays browsers capabilities as stated in https://github.com/rgrove/lazyload/pull/27) Firefox and Opera currently support parallel script loading while preserving execution order. To ensure that scripts are always executed in the correct order, LazyLoad will load all scripts sequentially in browsers other than Firefox and Opera (to be updated with nowadays browsers capabilities as stated in https://github.com/rgrove/lazyload/pull/27).
This being said:
In browsers that don't preserve the execution order of asynchronously-loaded scripts, LazyLoad will safely load the scripts sequentially.
It looks to me like an easy & quick improvement to the actual osc_register_script()
and osc_enqueue_script
?
I like it but wonder about 'cost' vs 'revenue', very wortwhile to try and see how it performs! Have you already tried to use this emanwebdev?
Hi, I'm not a native English speaker, but what I understood is that sequentially loading is only done in browsers NOT supported. In every other browser, it will load files async.
This could be a problem if one JS file depends on other (like a jQuery plugin).
I would need to test how this will work.
Add a dependency-free tiny (966 bytes) JavaScript utility that makes it super easy to load external JavaScript and CSS files on demand.
https://github.com/rgrove/lazyload