jquery.dataTables.js?v=Q0cguHZIfvl0zzk68PF1dGCY3pW2y6xvHx4GHLQ_lg4:4745 Uncaught TypeError: Cannot read property 'length' of undefined + mvc code example

Example: cannot read property 'length' of undefined datatables ajax

$(document).ready(function() {
    $('#example').DataTable( {
        "ajax": {
            "url": "data/objects_root_array.txt",
            "dataSrc": ""
        },
        "columns": [
            { "data": "name" },
            { "data": "position" },
            { "data": "office" },
            { "data": "extn" },
            { "data": "start_date" },
            { "data": "salary" }
        ]
    } );
} );