Skip to content
Advertisement

Datatables don’t load content of database

I’m trying to load users from a table in my database using datatables(https://datatables.net/) but the page is not loading anything at all. I’m getting these errors when I open the console [1]: https://i.stack.imgur.com/ykNTL.png

I loaded the js and css here in this order:

[uncaught ReferenceError: jQuery is not defined at dataTables.bootstrap.min.js:5 at dataTables.bootstrap.min.js:5][1]

    <script src="~/lib/dataTables/jquery.dataTables.min.js"></script>
    <script src="~/lib/dataTables/dataTables.bootstrap.min.js"></script>
    <scripts src="~/lib/jquery-validation/dist/jquery.validate.js"></scripts>
    <scripts src="~/plugins-site/jquery-ui/jquery-ui.min.js"></scripts>
    <link href="~/lib/dataTables/dataTables.bootstrap.min.css" rel="stylesheet" />
    <link href="http://cdn.datatables.net/1.10.24/css/jquery.dataTables.min.css"

/>

Advertisement

Answer

if the page is not loading anything at all after add Query library i reccommend add before link of script defer after that the table load every script make links like this

<script defer  src="~/lib/dataTables/jquery.dataTables.min.js" ></script>

read this script-async-defer

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement