Jesse Green
Jesse Green

Reputation: 373

Object doesn't support property or method 'dataTable' in Internet Explorer

I have a page that uses DataTables and works perfectly fine in every browser except Internet Explorer (all versions from 7-10 give the error). The error is as in the title Object doesn't support property or method 'dataTable'. The problem has been observed on multiple systems, I am testing it on a Virtual Box instance of Win7. The error is getting thrown on the first line after the ready function

$(document).ready(function(){
    var invoiceTable = $('#invoiceTable').dataTable( {
        "aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]],
        "iDisplayLength": 50,   // Set default of 50 rows
        "bSort": false
    })

The datatables library is loaded above that with

<script src="https:////cdn.datatables.net/1.10.5/js/jquery.dataTables.min.js" type="text/javascript"></script>

Anyone know what can cause IE to throw this error with DataTables?

Upvotes: 1

Views: 6408

Answers (1)

Gyrocode.com
Gyrocode.com

Reputation: 58890

Use this code instead:

<script src="https://cdn.datatables.net/1.10.5/js/jquery.dataTables.min.js" type="text/javascript"></script>

Upvotes: 4

Related Questions