简体   繁体   中英

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> 

I am trying to use jquery.dataTables.min.js in my asp.net mvc core 2.1 version. Though i have included my script lib in correct order i am getting the error saying "uncaught typeerror $(...).datatable is not a function".

this a typo? <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

should be <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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