Is Modernizr.load (Yepnope), intended for use in <head>

Since Modernizr.load and Yepnope are asynchronous loaders, is it better to use them at <head> or at the end of the page?

+4
source share
2 answers

It depends on the resources loaded. See this thread where Yepnope developer Alex Sexton says combine all resources into a single bootloader call. In practice, if any of the resources that you want to load using Modernizr.load or Yepnope affects what the user sees or needs when the page loads first, then IMO in most cases you want to call the loader after critical resources, but that's it same in <head> .

+2
source

Comment from developer yeapnope :

This is better at the end of the page, just before closing </body> .

I think it’s better to load them on the bottom page.

The modernizer and Yepnope must first be loaded onto the page to load other scripts. That way, when you add <script src="modernizer.js"> , you block the rendering time in the browser. This is because the browser stops all rendering while the script loads, compiles and executes.

Like yahoo and google say Delayed download scripts are always good.

-4
source

Source: https://habr.com/ru/post/1380069/


All Articles