Uncaught TypeError: $(...).DataTable is not a function

Uncaught TypeError: $(...).DataTable is not a function

luv_ignizluv_igniz Posts: 1Questions: 1Answers: 0

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Main</title>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"/>

<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.css">

<script type="text/javascript">
$(document).ready(function () {
$('#example').DataTable(
{
"searching": false,
"paging": false,
"ordering": false
}
);
});
</script>

I tried everything but it just cant load the css to to table

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @luv_igniz ,

    The error is because you haven't loaded the DataTables CSS, only the JS. Take a look at this example, it shows you the files you need to include,

    Cheers,

    Colin

This discussion has been closed.