【发布时间】:2020-03-08 12:25:12
【问题描述】:
我正在尝试将 jquery 和 css 文件添加到我的 .cshtml 文件中,但出现内容安全策略错误。
我已经尝试添加<meta http-equiv="Content-Security-Policy" content="default-src 'self' *.aspnetcdn.com/"> 之类的东西,但它不起作用。
Here are the errors that I am getting
这是 .cshtml 文件:
@using Genesis.SharedLibrary.ViewModels.Genesis.ALG
@inject Genesis.Application.Services.Commons.IGenericServices _genericServices;
@{
var staticFileVersion = _genericServices.GetAppSettingValue("OtherSettings", "StaticFileVersion");
}
@model List<TravelRequestAdminViewModel>
<body>
@* DATA TABLE WITH SEVEN COLUMNS AND MANY ROWS *@
</body>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.20/css/jquery.dataTables.min.css" />
<link rel="stylesheet" type="text/css" href="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/css/jquery.dataTables.css" />
<script type="text/javascript" src="~/lib/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.js"></script>
<script src="~/shared/js/Views/travelRequestAdminScript.js?v=@staticFileVersion"></script>
【问题讨论】:
-
查看link
标签: javascript c# html css ajax