许多推荐的脚本应该放在页面底部 - 这包括 Cufon 吗?
所有前端开发人员都会听到一些专家表示,最好的做法是将脚本放在页面底部。
我的问题是,这也包括库丰吗? (当然是我们,如果您使用的是 Cufon)。
顺便说一句..我最近听说了http://headjs.com/。同样的问题 - 我们可以将 Cufon 脚本放入其中吗?或者我们会冒“闪现无风格内容”的风险吗?
All front end developers out there will have heard some experts state that it is best practice to put scripts at the bottom of the page.
My question is, does this include Cufon also?
(that us, if you are using Cufon of course).
As an aside.. I recently heard about http://headjs.com/. Same question here - can we put our Cufon script inside of this? Or would we risk having a 'Flash of Unstyled Content'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您绝对可以将其放在页面底部。不过,需要提一下的是,不要忘记在
标记之前调用
Cufon.now()
。喜欢:You can definitely put this at the bottom of the page. However, just to mention don't forget to call
Cufon.now()
before</body>
tag. Like:是的,它包括 Cufon
将脚本放在头部有一些原因,我知道的两个原因是通过将函数存储在头部并将执行数据存储在底部来防止竞争条件;另一种是基于广告要求。
Yes it includes Cufon
There are some reasons to put scripts in the head, the 2 reasons I know of are to prevent a race condition by storing the functions in the head and execution data on the bottom; the other is based on ad requirements.