是Modernizr.load(Yepnope)意味着在< head>中使用 [英] Is Modernizr.load (Yepnope) meant to be used in the <head>

查看:115
本文介绍了是Modernizr.load(Yepnope)意味着在< head>中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Modernizr.load Yepnope 是异步加载器,在< head> 或结束时使用它们是否更好?页面?

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

推荐答案

这取决于所加载的资源。请参阅此主题,其中 Yepnope 开发人员Alex Sexton说要将所有资源合并到一个对加载器的调用中。实际上,如果要使用 Modernizr.load Yepnope 加载的任何资源影响用户看到的内容或当页面首次加载时需要,然后IMO在大多数情况下你想在关键资源之后调用加载器,但仍然在< head>

It depends on the resources being loaded. See this thread where Yepnope developer Alex Sexton says to combine all the resources into one call to the loader. In practice, if any of the resources you want to load with Modernizr.load or Yepnope affect what the user sees or needs when the page first loads, then IMO in most cases you want to call the loader after your critical resources but still in the <head>.

这篇关于是Modernizr.load(Yepnope)意味着在&lt; head&gt;中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆