DataTables logo DataTables

Object doesn't support property or method 'dataTable'
  • I am getting the above bug if I use jQuery-1.6 in my project. For jQuery-1.5.1 it is working fine. My code is:
       $("body").ready(function () {                            
                    "bServerSide": true,
                    "bStateSave": true,
                    "sAjaxSource": "Internal/ticket/IntVerifyOrder",
                    "bJQueryUI": true,
                    "sStripEven": "odd",
                    "bProcessing": true,
                    "sPaginationType": "full_numbers",
                    "aoColumns": [
                            { "sName": "ID", "bSearchable": false, "bSortable": false },
                            { "sName": "Service_ID" },
                            { "sName": "blank" },
    	       { "sName": "Service_Shift_Item_ID" },
                            { "sName": "Shift_ID" },
                            { "sName": "Status" },
                            { "sName": "Notes" },
                            { "sName": "ImportProcessStatus" }		            ]

  • Can you link us to a page which shows the error please? Myself and others have all run DataTables successfully with jQuery 1.6 and 1.6.1.

  • Not sure if there was ever a resolution to this, but I'm getting a similar error due to this line of code:

    availableSessionGroupDetailsTable = $('#availableSessionGroupDetailsTable').dataTable({  //grid is the id of the table
                "bJQueryUI": true,
                "bLengthChange": false,
                "bFilter": true,
                "sPaginationType": "full_numbers",
                "bInfo": true,
                'aaData': arrayData,
                'bRetrieve': true,
                'aoColumns': [
                        { "bSearchable": true, "sTitle": "Name" },
                        { "bSearchable": true, "sTitle": "Description" },
                        { "bSearchable": false, "bVisible" : false }

    Would there be a specific reason this would happen in IE8?

  • No - I can't think of why this would happen in IE8 only. The error means that either the DataTables plug-in hasn't been loaded, jQuery has been loaded again (thus overwriting the old one) or $ is not jQuery.

  • You need to initialise all variables in IE8. It means that the first line must be

    var availableSessionGroupDetailsTable = $('#availableSessionGroupDetailsTable').dataTable({  
  • Ah! Interesting - I didn't know that, but very useful knowledge. It should be that it means the variable is entered into the global scope, but apparently that doesn't always happen!

This discussion has been closed.
All Discussions