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

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

Europia79Europia79 Posts: 2Questions: 1Answers: 0

Trying to get DataTables working, but it's not displaying.

http://198.143.136.199/datatables/testcase1/

The relevant lines of are

55:   jquery.min.js
56:   jquery.dataTables.js
329:  <table> starting point
2813: DataTable() method invocation on $('#TableID')

I ran the HTML code thru a validator & removed all the errors.
Then I ran the browser console & DataTables debugger.
The debugger shows version information, but errors out on other the other checks.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin
    Answer ✓

    You are loading jQuery twice. Once from the Google CDN and again in default_layout.js. That second one is erasing the first which has DataTables attached to it.

    Allan

  • Europia79Europia79 Posts: 2Questions: 1Answers: 0

    Yes, it works! Thankyou!

    http://198.143.136.199/datatables/testcase2/

    I also thought jquery was being loaded twice, hence the original comment on line 54.

    But I didn't know where it was being loaded from.

    What was your thought process for figuring this out ?

    Btw, this should be added to the FAQ ?

This discussion has been closed.