should Modernizr file be placed in head?

后端 未结 4 1128
长情又很酷
长情又很酷 2020-12-23 09:16

Should the reference to the Modernizr JavaScript file be in the head of the page? I always try and place all scripts on the bottom of the page and would like to preserve thi

4条回答
  •  时光说笑
    2020-12-23 09:50

    How about using IE conditionals in a slightly different way? What does everyone think of this solution:

    Within the tags:

    
    
    

    Before the end of the tag:

    
    
    
    
    

    This would result in Modernizr loading in the head for IE8 and below, and it will load before the body for any other browsers.

    Open discussion on pros and cons welcome in the comments.

提交回复
热议问题