Trying to make ajax call but not working
Trying to make ajax call but not working
kingharrison
Posts: 1Questions: 1Answers: 0
I am trying to have DataTables make an ajax call to a route that responds with JSON. The route looks exactly as expected but DataTables is not making a call to the route to get the data. It works fine with the basic setup. In developer tools on network I don't see it making the call. What am I doing wrong? code listed:
$(document).ready(function() {
$('#example').DataTable({
"processing": true,
"serverSide": true,
"ajax": "/json/nightjoblog/index"
}
});
} );
This discussion has been closed.
Answers
Hi,
Thanks for posting up the code. It looks like there is a small syntax error in the code above - a "spare"
}
immediately after theajax
option.Perhaps try:
If that doesn't work, could you check the debug console in your browser, and if there is an error reported let me know. If there are no errors, perhaps you could run the debugger over the table and let me know the debug code so I can have a little look and see what DataTables is doing!
Thanks,
Allan