Mobile app version of vmapp.org
Login or Join
Rambettina238

: Can I defer loading Modernizr? I'm using an HTML5 template that makes thorough use of the semantic tags and includes Modernizr up top to do the necessary IE coaxing. Google PageSpeed is complaining

@Rambettina238

Posted in: #Javascript #Performance #Seo

I'm using an HTML5 template that makes thorough use of the semantic tags and includes Modernizr up top to do the necessary IE coaxing. Google PageSpeed is complaining about the blocking JavaScript and recommending a deferred load, but as I understand it Modernizr has to load first to prevent IE from choking. Is PageSpeed wrong about this particular item, or can I push the Modernizr load down to the bottom of the page?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Rambettina238

2 Comments

Sorted by latest first Latest Oldest Best

 

@Sarah324

try this: developers.google.com/speed/docs/insights/BlockingJS
or insert async tribute in this javascript

10% popularity Vote Up Vote Down


 

@Si4351233

From Modernizr installation page:


Drop the script tags in the HEAD of your HTML. For best performance, you should have them follow after your stylesheet references. The reason we recommend placing Modernizr in the head is two-fold: the HTML5 Shiv (that enables HTML5 elements in IE) must execute before the BODY, and if you’re using any of the CSS classes that Modernizr adds, you’ll want to prevent a FOUC.


Modernizr is pretty fast and lean, especially if you have used their customizer to trim out the features you don't need to use

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme