News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Uncaught TypeError: $ is not a function (datatables test)

Started by spiros, June 19, 2021, 07:38:22 AM

Previous topic - Next topic

spiros

I try to use datatables in SMF (I used the html tag to paste the html code). Normally, it is pretty straightforward, just link some js and css and initialize with a js snippet.

I tried implementing directly in index.template.php and also the header and footer plugin (current test). But I get Uncaught TypeErrors.

Uncaught TypeError: k is not a function
    at jquery.dataTables.min.js:114
    at jquery.dataTables.min.js:21
    at jquery.dataTables.min.js:21
datatables.js:1 Uncaught TypeError: $ is not a function
    at datatables.js:1


You can see it here https://www.translatum.gr/forum/index.php?topic=50993.0

See discussion at datatables where jquery no conflict appears to be the issue https://datatables.net/forums/discussion/68771/uncaught-referenceerror-is-not-defined#latest

Also, I can see it implemented (?) in Elkarte https://gist.github.com/joshuaadickerson/c528aae77d1cf0de029d (search for datatable).

Advertisement: