juppix: JSON - falsches Format

Beitrag lesen

Das sollte es nun sein:

<script>
$(document).ready(function() {
    $('#example').DataTable( {
        "ajax": './getCalendarData.php',
		"dataSrc":'',
		"columns": [
			{ "data": "id" },
			{ "data": "typ_id" },
			{ "data": "day" },
			{ "data": "users_id" },
			{ "data": "text_short" },
			{ "data": "text_long" }
	]
	} );
} );
</script>

Aber ich erhalte in der Konsole den Fehler:

Uncaught TypeError: Cannot read property 'length' of undefined

at datatables.min.js:89
at i (datatables.min.js:76)
at Object.success (datatables.min.js:76)
at i (datatables.min.js:14)
at Object.fireWith [as resolveWith] (datatables.min.js:14)
at A (datatables.min.js:16)
at XMLHttpRequest.<anonymous> (datatables.min.js:16)

(anonymous) @ datatables.min.js:89 i @ datatables.min.js:76 success @ datatables.min.js:76 i @ datatables.min.js:14 fireWith @ datatables.min.js:14 A @ datatables.min.js:16 (anonymous) @ datatables.min.js:16 load (async) send @ datatables.min.js:16 ajax @ datatables.min.js:16 sa @ datatables.min.js:77 ga @ datatables.min.js:89 e @ datatables.min.js:133 (anonymous) @ datatables.min.js:133 each @ datatables.min.js:14 each @ datatables.min.js:14 m @ datatables.min.js:123 h.fn.DataTable @ datatables.min.js:205 (anonymous) @ ?p=calendar:51 j @ datatables.min.js:14 k @ datatables.min.js:14 setTimeout (async) (anonymous) @ datatables.min.js:14 i @ datatables.min.js:14 fireWith @ datatables.min.js:14 fire @ datatables.min.js:14 i @ datatables.min.js:14 fireWith @ datatables.min.js:14 ready @ datatables.min.js:14 S @ datatables.min.js:15