我想使用 RenderJsHere() 渲染两个不同的 javascript 文件包。
我已将它放在页面上的两个不同位置,但它在两个位置都显示了所有文件(第 1 组 + 第 2 组文件)。谁能指导我如何使用 RenderJsHere() 渲染两组不同的文件?
下面是一些示例代码。
谢谢,
@inherits Umbraco.Web.Mvc.UmbracoViewPage
@using ClientDependency.Core.Mvc
<!DOCTYPE html>
<html>
<head>
@Html.RenderCssHere()
@{
Html.RequiresJs("~/content/js/jquery-3.5.1.js", 1);
}
@Html.RenderJsHere() =========== **1st group of files in header**
</head>
<body>
Some HTML here
Bottom of page
@{
Html.RequiresJs("~/content/js/bootstrap.js", 1);
Html.RequiresJs("~/content/js/jquery.lazy.js", 2);
Html.RequiresJs("~/content/js/slick.js", 3);
Html.RequiresJs("~/content/js/app.js", 4);
Html.RequiresJs("~/content/js/myjs.js", 5);
}
@Html.RenderJsHere() **2nd group of files at last in page**
</body>
</html>