Async loading of javascript files using MVC4 Bundling and HTML5 async attribute

后端 未结 1 745
闹比i
闹比i 2020-12-24 11:41

HTML5 has an async attribute for script files, to enable async loading.


         


        
1条回答
  •  孤城傲影
    2020-12-24 11:49

    If you upgrade to the 1.1-alpha1 release, you can just add the async attribute to the tag format either via:

    Scripts.DefaultTagFormat = @""
    

    or passing it where you want the async tag

    Use following instead of Scripts.Render("~/bundles/jquery")

    Scripts.RenderFormat(@"", "~/bundles/jquery")
    

    0 讨论(0)
提交回复
热议问题