Many recommended scripts should go at the bottom of the page - does this include 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'
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:
<script type="text/javascript"> Cufon.now(); </script>
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.
精彩评论