John Public
John Public

Reputation: 33

DataTables Ajax error - Invalid JSON response

I'm using jQuery DataTables 1.10, the problem I'm having is the table loads the data and such from a service and the JSON is valid but after a few tries running it displays an alert periodically:

DataTables warning: table id=reportsTable - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1

So sometimes it runs perfectly fine then the alert just shows then I refresh and it loads the data. I researched online but to no success. What am I doing wrong?

Below is a screenshot of the error:

Screenshot

Upvotes: 1

Views: 2681

Answers (1)

binit92
binit92

Reputation: 95

These kind of errors can come if your JSON response has invalid structure or null. You can use tools like to verify your JSON response. e.g. JSONLint http://jsonlint.com/

Also, to disable error messages, you can change the opensourcedatatable.js script itself. Details: Correctly Suppressing Warnings in DataTables?

Upvotes: 1

Related Questions