Error in Google Chrome


  • Make sure that your THEAD cells uses TH and not TD
  • Posts: 2
    Thanks a ton Carl.
  • what if i load the column names from the server? i'm getting this error and i pass in a iColumns sColumns. :/
  • Posts: 22,739
    If you load column names from the server, you need to do some kind of post processing on the Ajax response form the server since DataTables won't automatically put in any column information from the server. For example you could do $.ajax() to get the initialisation you want for the DataTable and then just use that for the initialisation.

  • Hello,
    Chrome error is not something unique happened to you.
    Sometimes there is a dreadful total crash of the browser and sometime it sends ddifferent errors, upon restarting nothing happens.
    Such sorts of errors can be linked to the file association issues. The file association references are the important components of the registry database in Windows.
    A registry repair scan, which has the power to fix file association errors, will help you to find the solution for Google chrome error.

    I fixed this error after reading this article

    Hope you might get help from this article too.
  • Hey,
    I had this error too. I solved it by changing my table's HTML. I didn't have thead and tbody, so I did:

    <table> <thead> <tr> <th>Column 1</th> <th>Column 2</th> </tr> </thead> <tbody> <tr> <td>Row 1</td> <td>Row 1</td> </tr> </tbody> </table>
  • I had this problem when I incorrectly defined my aaSorting like this:
    "aaSorting": [0, 'asc'] instead of:
    "aaSorting": [[0, 'asc']]
  • Posts: 3
    what if i dont need thead? is it possible?
  • Posts: 22,739
    No - DataTables requires a thead element -

  • I ran into this issue too, I definitely think DataTables should detect that the table doesn't define any 'th' elements and throw a corresponding exception. The current error is way too indirect and difficult to relate to the originating issue (i.e., that the table doesn't define column headers).
  • Posts: 22,739
    It isn't as simple as that I'm afraid - DataTables can actually create a thead element for you if it does detect one, you need to supply sName for the columns and it will create the element. This is useful for dynamically created tables.

    Ultimately yes, there should be a 'debug' version of DataTables that provides trace information about everything so every little issue can be tracked and understood, but like jQuery the general view with DataTables is that there isn't much error handling since it is redundant code once you've got your table correctly setup.

    Not to say it isn't useful! I really do want to do a debug version, and have done for years. Other things just keep taking priority!

  • Didn't realize it'd be that infeasible to throw an exception in case table headers are missing, but then again I'm not a JavaScript guru.
  • Posts: 22,739
    No its not infeasible - you'd just do if ( $('thead', table).length === 0 ) { throw 'No thead!'; } - what I'm suggesting is that it isn't practical since DataTables can, under certain conditions, inject and build a thead element, with columns for you - so simply not having a thead is not a valid test (in this specific case).

    So certainly it is possible (as most things are with a little extra code :-) ), but adding error conditions is not something I want to put into DataTables core at this time - it would be suitable for a debug version, which is on the cards, but a good way out (with v1.10 taking priority at the moment).

  • edited February 2013 Posts: 2
    I'm having this issue with "Uncaught TypeError: Cannot read property 'className' of undefined " and it drives me crazy. Double checked table structure - yes, it has thead and tbody element
    The error happens with simple initializaition with no parameters

    error happens here:
    /* Classes */
    if ( bClass )
    nCell.className += ' '+oCol.sClass;

    my debug code is
  • my fault. i had inconsistent td number between tr.
This discussion has been closed.