CodeIgniter Forums
Uncaught SyntaxError: Unexpected token { - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: General (https://forum.codeigniter.com/forum-1.html)
+--- Forum: Lounge (https://forum.codeigniter.com/forum-3.html)
+--- Thread: Uncaught SyntaxError: Unexpected token { (/thread-74419.html)



Uncaught SyntaxError: Unexpected token { - davidevillers - 09-20-2019

good evening,
i am using codeigniter, AJAX and table.js

but i get an error in my console
-> Uncaught SyntaxError: Unexpected token {

and also that one
-> DataTables warning: table id=user_data - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1

obviously i ve tryed to sort it out by reading http://datatables.net/tn/1, but unfortunatly i can't solve it out.

Could someone help me ?


RE: Uncaught SyntaxError: Unexpected token { - ciadmin - 09-20-2019

This is a Javascript problem, so your thread has been moved to the "lounge".


RE: Uncaught SyntaxError: Unexpected token { - php_rocs - 09-20-2019

@davidevillers,

I've had this error before. It could be one of several issues. You have dirty data (data that is not consistent). You ARE actually missing an ending bracket or one of your columns has been defined incorrectly.

Things to check.
Are you receiving an error in the browser?
Remove the database data and give it clean test data (to see if the error still appears).