jQuery Script included at bottom of page in mvc 4 template

后端 未结 3 571
情书的邮戳
情书的邮戳 2021-01-18 12:34

I was looking at the MVC 4 release candidate and the default Internet template that is included. I noticed that in the _Layout.cshtml, they are including the jQuery bundle a

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-18 13:07

    I can't answer specifically for this case, but the idea is generally that the browser is attempting to render the page in approximately document order. Having the scripts included last means that the renderer can do its work and render the static portions of the page, and then the scripts will be loaded. I couldn't give any concrete figures on how much it really affects the user experience, but the idea is to make it such that the page is viewable before the scripts have finished loading.

提交回复
热议问题