2

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'

Starx
  • 77,474
  • 47
  • 185
  • 261
swisstony
  • 1,667
  • 3
  • 18
  • 27

2 Answers2

1

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>
Naveed Ahmad
  • 3,176
  • 1
  • 15
  • 18
  • Hi Naveed, sure I realise Cufon will work fine if you put it in the bottom. Just wonderign where is the BEST place for it. I thought perhaps Cufon would be considered 'special' because it affects the appearance of your typography. – swisstony Apr 18 '11 at 00:06
  • @swisstony - It's always a good practice to put your javascripts at the bottom. – Naveed Ahmad Apr 18 '11 at 12:05
0

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.

timewaster51
  • 120
  • 5