Question

Currently, I am using headjs to load my javascript files dynamically.

I have bunch of plugins in my one-app page which I download & load the plugins when required.

However, I notice that most of the plugins have css files which I load in the beginning of he app itself using

I see that only yepnope loader allows dynamic loading of css.

What time do you save showing the page when dynamically loading css versus including it in the link in the header?

Was it helpful?

Solution

The point of yepnope is to load one file if a condition is matched and another if not. It's often used as part of Modernizr so you can feature detect your snazzy CSS transitions or whatever, and load your jQuery scripts instead if it's not supported. So the time saving is in either not loading things which aren't supported, or not loading a shim when a feature issupported natively.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top