繁体   English   中英

Asp.net(MVC)Core 2.1版本Jquery数据表插件问题

[英]Asp.net (MVC)Core 2.1 version Jquery Data table plugin issue

 <link href="https://cdn.datatables.net/1.10.15/css/dataTables.bootstrap.min.css" rel="stylesheet" /> <link href="https://cdn.datatables.net/responsive/2.1.1/css/responsive.bootstrap.min.css" rel="stylesheet" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="https://cdn.datatables.net/1.10.15/js/jquery.dataTables.min.js"></script> <script src="https://cdn.datatables.net/1.10.15/js/dataTables.bootstrap4.min.js "></script> <div class="container"> <br /> <div style="width:90%; margin:0 auto;"> <table id="example" class="table table-striped table-bordered dt-responsive nowrap" width="100%" cellspacing="0"> <thead> <tr> <th>CustomerID</th> <th>Name</th> </tr> </thead> </table> </div> </div> <script> $(document).ready(function () { $("#example").DataTable({ "processing": true, // for show progress bar "serverSide": true, // for process server side "filter": true, // this is for disable filter (search box) "orderMulti": false, // for disable multiple column at once "ajax": { "url": "https://data.sfgov.org/resource/RowID.json", "type": "GET", "datatype": "json" }, "columnDefs": [{ "targets": [0], "visible": false, "searchable": false }], "columns": [ { "data": "number_of_alarms", "name": "number_of_alarms", "autoWidth": true }, { "data": "on_scene_dttm", "name": "on_scene_dttm", "autoWidth": true }, ] }); }); </script> 

我正在尝试在asp.net mvc core 2.1版本中使用jquery.dataTables.min.js。 虽然我以正确的顺序包含了我的脚本库,但是却收到错误消息:“未捕获的typeerror $(...)。datatable不是函数”。

这是错字吗? <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

应该是<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM