Uncaught TypeError: Object [object Object] has no method 'dataTable'

Uncaught TypeError: Object [object Object] has no method 'dataTable'

johnleejohnlee Posts: 1Questions: 0Answers: 0
edited May 2012 in General
Pardon me for asking this noob question, which many have asked before. The most common mistake are that the js is not properly included or the order of the included js is affecting the dependencies. I have kind of rule out 2 of this possible mistakes and I am still puzzled why I am getting the no method error.

On inspection this is how it looks like:

[code]










[/code]

In my main.js, I only have the code below:

[code]
$(document).ready(function() {
$('#table_id').dataTable();
});
[/code]

Correct me if I am wrong, the core DataTable css and js are included and the order is correct. Appreciate any advice.

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,473 Site admin
    That looks about right to me - you are loading DataTables twice (min and full), so I'd drop one of them, but other than that, it should be okay. You aren't loading jQuery again in min.'s or application.js by any chance? If you run the debugger over the table (link at bottom of this page), it will tell you if DataTables is loaded on the page or not.

    Allan
  • emeshurisemeshuris Posts: 1Questions: 0Answers: 0
    Thanks Allan,
    I am using MVC 4 and this was killing me, it is adding the jquery bundle to the bottom of the page.
  • acrkgacrkg Posts: 1Questions: 0Answers: 0
    thx, it works
This discussion has been closed.