Responsive extension: Uncaught ReferenceError: jQuery is not defined at dataTables.responsive.min.js

Responsive extension: Uncaught ReferenceError: jQuery is not defined at dataTables.responsive.min.js

Diego ApuglieseDiego Apugliese Posts: 8Questions: 3Answers: 0

Link to test case: https://datatables.net/extensions/responsive/examples/initialisation/className.html
Debugger code:
Error messages shown: Uncaught ReferenceError: jQuery is not defined at dataTables.responsive.min.js
Description of problem: I'm trying to test the example you give us on your website about responsive extension. After I implemented this example and run it, I can see the datatable in the browser but non in a responsive way. In the google chrome browser inspector I've verified this error "Uncaught ReferenceError: jQuery is not defined at dataTables.responsive.min.js".

What could be the problem?

Thanks in advance.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,468Questions: 26Answers: 4,977
    Answer ✓

    The JS include load order is important. Are you loading dataTables.responsive.min.js after jquery.js and datatabbles.js?

    If this doesn't help then the Test Case we need to see is a link to your page or a test case replicating the problem you have.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • Diego ApuglieseDiego Apugliese Posts: 8Questions: 3Answers: 0
    edited May 2020

    Thanks kthorngren. It was that!.

    I re-ordered the .js files and it work perfectly.

    This is the correct order:

    <script type="text/javascript" src="datatables/js/jquery-3.3.1.js"></script>
    <script type="text/javascript" src="datatables/js/jquery.dataTables.min.js"></script>
    <script type="text/javascript" src="datatables/js/dataTables.responsive.min.js"></script>
    <link rel="stylesheet" href="datatables/css/jquery.dataTables.min.css">
    <link rel="stylesheet" href="datatables/css/responsive.dataTables.min.css">
    

    Thanks again!.

    Diego.

This discussion has been closed.