urish / angular-load

Dynamically load scripts and css stylesheets in your Angular.JS app
MIT License
243 stars 65 forks source link

Is it platform independent? #7

Closed slavafomin closed 8 years ago

slavafomin commented 9 years ago

Hello! Thanks for this module!

I'm just curious, you are using onload event in order to detect when script or stylesheet loads. Is it compatible with all current platforms/browsers?

I've just read a very comprehensive article of how it is difficult to detect when external resource is loaded in a cross-platform way and was surprised that you are using such a straightforward approach. Can you elaborate please? Thanks!

slavafomin commented 9 years ago

Here's the CSS loading code from ocLazyLoad: https://github.com/ocombe/ocLazyLoad/blob/master/src/ocLazyLoad.js#L122-L160

Looks like they are using some kind of polling in corner cases.

urish commented 9 years ago

Thanks for the example @slavafomin, seems like they are targeting older webkit based browsers in this example. These browsers are already a few years old, and gradually disappearing, so in my opinion, it is not worth adding the extra code.

slavafomin commented 9 years ago

Thanks for your answer @urish!

However, I'm still worried about browser compatibility. Is there a compatibility table of some kind or have your performed compatibility tests?

urish commented 9 years ago

@slavafomin just tested against IE9+, Firefox latest, Chrome latest. If you have the time to write an e2e test, we can run it on saucelabs, as they have an extensive set of platforms, and get a more accurate list of supported browsers.