jQuery脚本包含在mvc 4模板的页面底部

Dis*_*ile 6 asp.net-mvc asp.net-mvc-4

我正在查看MVC 4候选版本以及包含的默认Internet模板.我注意到在_Layout.cshtml中,它们在页面底部包含了jQuery包:

        @Scripts.Render("~/bundles/jquery")
        @RenderSection("scripts", required: false)
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

有没有理由将脚本包含在页面底部而不是带有modernizr脚本的head部分?这样做有什么好处吗?我总是认为你应该在头部包含你的脚本.

BZi*_*ink 7

这通常是为了提高性能.查看雅虎性能指南.

http://developer.yahoo.com/performance/rules.html/

他们解释了为什么脚本可以在底部更好.