Datatables or hambuger menu, not together

Datatables or hambuger menu, not together

Tripple DeltaTripple Delta Posts: 8Questions: 1Answers: 0

Link to test case: https://www.testvrij.be/admin/test.php
Debugger code (debug.datatables.net):
Error messages shown: no error on page
Description of problem:

Hi all,

I've setup a responsive site a while ago before I knew about datatables. Now I'm trying to implement datatables. All is working well but as soon as I add this code at the bottom of my page needed for the hamburger menu datatables doesn't work anymore:

script src="/js/jquery/jquery-2.2.4.min.js"></script>
( I had to remove the < here to display this line )

When I remove this line again, my hamburger menu is gone and datatables is back. Looks like I have to choose between the two.

Any idea how to fix this?

Thanks.

Replies

  • kthorngrenkthorngren Posts: 21,330Questions: 26Answers: 4,951

    You are getting this error in the browser's console:

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

    You are loading jquery.js twice; once on line 20 and then again on line 154. You should load it only once and it needs to be loaded before any of the other JS includes that require jquery. Datatables supports both jquery 3.5.1 (line 20) and 2.2.4. Maybe your code for the hamburger menu doesn't work with 3.5.1. If thats the case then replaces line 20 with 154.

    Also take a look at the browser's console for errors when the hamburger menu doesn't work.

    Kevin

  • Tripple DeltaTripple Delta Posts: 8Questions: 1Answers: 0

    Unbelievable. That way it works perfectly. Thanks for the advice.

Sign In or Register to comment.