在playframework2.6.3中没有工作dataTables

时间:2017-09-13 08:30:27

标签: playframework datatables-1.10

我使用playframework2.6.3并想使用dataTables(jquery-2.2.4,DataTables-1.10.15)。但它不起作用。我看到简单的HTML。

<!DOCTYPE>
<html lang="en">
<head>
    <title>table</title>

    <link rel="shortcut icon" type="image/png" href="@routes.Assets.versioned("images/favicon.png")">
    <link rel="stylesheet" media="screen" href="@routes.Assets.versioned("stylesheets/css/jquery.dataTables.min.css")">
    <script src="@routes.Assets.versioned("javascripts/jquery-2.2.4.min.js")" type="text/javascript"></script>
    <script src="@routes.Assets.versioned("javascripts/jquery.dataTables.min.js")" type="text/javascript"></script>
</head>
<body>
    <table id="example" class="display" cellspacing="0" width="100%">
        <thead>
            <tr>
                <th>Column 1</th>
                <th>Column 2</th>
                <th>Column 3</th>
                <th>Column 4</th>
                <th>Column 5</th>
            </tr>
        </thead>
        <tfoot>
            <tr>
                <th>Column 1</th>
                <th>Column 2</th>
                <th>Column 3</th>
                <th>Column 4</th>
                <th>Column 5</th>
            </tr>
        </tfoot>
    </table>
</body>

enter image description here

我的依赖项不起作用。为什么呢?

1 个答案:

答案 0 :(得分:0)

已更改

  

play.filters.headers.contentSecurityPolicy =“default-src'self'”

例如

  

contentSecurityPolicy =“default-src *; style-src *'unsafe-inline'; script-src *'unsafe-inline''unsafe-eval'; img-src * data:'unsafe-inline'; connect- src *'unsafe-inline'; frame-src *;“