Topic: datatables - table with sorting errors jquery.dataTables.min.js:5 Uncaught ReferenceError: jQuery is not defined and DataTable is not a function
cpshart free asked 6 years ago
leneborma free answered 5 years ago
The $(…).modal is not a function is usually caused because scripts are loaded in the wrong order . The browser will execute the scripts in the order it finds them. If in a script you attempt to access an element that hasn't been reached yet then you will get an error. Make sure that you don't have a script above one that it requires.
Plugin dependencies
Some plugins and CSS components depend on other plugins. If you include plugins individually, make sure to check for these dependencies in the docs. Also note that all plugins depend on jQuery (this means jQuery must be included before the plugin files).
Multiple jQuery instances
Sometimes this warning may also be shown if jQuery is declared more than once in your code. The second jQuery declaration prevents bootstrap.js from working correctly. The problem is due to having jQuery instances more than one time. Take care if you are using many files with multiples instance of jQuery. Just leave one instance of jQuery and your code will work.
Mikołaj Smoleński staff commented 5 years ago
Thanks for sharing your remarks. It might be helpful for other users.
Mikołaj Smoleński staff answered 6 years ago
- jQuery
- popper
- bootstrap
- mdb
- dataTables
cpshart free answered 6 years ago
I just solved the demo code I needed to load jquery-3.2.1.min.js before the jquery.dataTables.min.js script as follows :-
<script type="text/javascript" src="js/jquery-3.2.1.min.js"></script>
<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
I still have some errors on my project code, but I will build it from this template hopefully ..
Uncaught TypeError: $(...).sideNav is not a function
at transactions-a.php:31
(anonymous) @ transactions-a.php:31
22:30:49.875 transactions-a.php:688 Uncaught TypeError: $(...).modal is not a function
Thanks Colin
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Free
- Premium support: No
- Technology: MDB jQuery
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No