3 ms·
The original bare-bones version of LoadJS was down to 455 bytes and grew to 710 as we added some useful features (e.g. CSS loading, async false support, load re
by andres 10y ago
The original bare-bones version of LoadJS was down to 455 bytes and grew to 710 as we added some useful features (e.g. CSS loading, async false support, load retries).
Initially I was hesitant to add CSS support because handling load errors across browsers is very tricky but I think we came up with a good solution [1] that is tested down to IE9 [2].
[1] https://github.com/muicss/loadjs/blob/master/src/loadjs.js#L109-L119 https://github.com/muicss/loadjs/blob/master/src/loadjs.js#L...
[2] https://github.com/muicss/loadjs/blob/master/test/tests.js#L188-L301 https://github.com/muicss/loadjs/blob/master/test/tests.js#L...
- pygy_ 10y agoGood job on detecting CSS loading failures. The little-loader also has a section to detect JS loading and errors in IE8/9 (with a dedicated sub-section for the former), I didn't see anything like this in LoadJS... Did you find a terser workaround? https://github.com/walmartlabs/little-loader/blob/42d233f360162bb01fce5a9664b6ef54751bd96e/lib/little-loader.js#L101-L207 https://github.com/walmartlabs/little-loader/blob/42d233f360... I'm somewhat familiar with little-loader because I've worked at making it smaller, but I'm not competent to judge whether its approach is necessarily the best...
- andres 10y agoWe use the `onerror` handler to detect load errors on IE9: https://github.com/muicss/loadjs/blob/master/src/loadjs.js#L106-L134 https://github.com/muicss/loadjs/blob/master/src/loadjs.js#L...