Undefined function dataTables() on simplest possible usage

Undefined function dataTables() on simplest possible usage

bimarguliesbimargulies Posts: 13Questions: 0Answers: 0
edited August 2010 in General
I'm trying to add DataTables 1.7 to the rest of my jquery usage. So, I load the usual:
[code]




[/code]



$(document).ready(function() {
$('#main').dataTable();
} );


yields, in chrome: Uncaught type error: <# anObject> has no method 'dataTable'.

Puzzled, I am.

Replies

  • cdaiglecdaigle Posts: 57Questions: 0Answers: 0
    You need to include the dataTables javascript file as well.

    jquery-1.4.2.min.js
    jquery-ui-1.8.2-custom.min.js
    **jquery.dataTables.min.js**
  • bimarguliesbimargulies Posts: 13Questions: 0Answers: 0
    I did load that, I'll edit my question.
  • cdaiglecdaigle Posts: 57Questions: 0Answers: 0
    Not sure if its a typo but you have 'test/javascript' rather than 'text/javascript'.

    For the most part though, as long as you have a table predefined with the id '#main' you should be alright.
    If your still having problems, posting the basic html (table definition) would help.

    Here is a basic example from the website that works: http://datatables.net/examples/basic_init/zero_config.html
  • bimarguliesbimargulies Posts: 13Questions: 0Answers: 0
    Oh, no, not the 'test/' again! That's the second time today. Sorry to waste your time.
This discussion has been closed.