I have a little trouble using the datatable.
I think I have declared my sources with jquery first and then datatable (I was on their site to retrieve the link that contains the latest version) but when I load the web page I always have the same error message:
Uncaught SyntaxError: Unexpected token { jQuery.Deferred exception: $ (...). DataTable is not a function TypeError: $ (...). DataTable is not a function at HTMLDocument. (https: // localhost: 44338 / Events: 87: 27) at l (https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:29375) at c (https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:29677) undefined
This is obviously a known problem and I realized after some research but I still can not solve it ...
@model IEnumerable<jak.formulaire.Models.Events>
@* Datatable of Events member *@
<table id="example" class="display" style="width:100%">
<thead>
<tr>
<th>Event name</th>
<th>Status</th>
</tr>
</thead>
</table>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css"></script>
<script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
@section Scripts{
<script>
$(document).ready(function () {
$('#example').DataTable();
});
</script>
}
EDIT// I post an image of the network result.
jquery.js
– Shyju