ajax request 404 error |
I am working on a simple DataTables page. The DataTable will get the data with an Ajax Call. My DataTables setup (javaScript) is below:
Code: $("#tblReport").DataTable({ I have a controller class called Reports.php and all my other methods work fine. When I load the datatables, I get a 404 error. However, when I type the same address in my browser, I get the JSON data I expected. I have added the method to the Routes.php file as well. Does anyone have any ideas?
It looks like you're using server-side processing, yet you don't process the data from your ajax call.
Replace it with the following: PHP Code: "sAjaxSource": "/reports/ajaxopenwolist",
See: https://codeigniter.com/user_guide/general/ajax.html
On your ajax part you would add headers to support this. edit: It also depends on what the URL in your routes is accepting, if for example you use the get() method. Personally i would use (and i'm using this) the url_to() for this part. > routes - https://codeigniter.com/user_guide/incom...al-options > url_to() - https://codeigniter.com/user_guide/helpe...tml#url_to |
Welcome Guest, Not a member yet? Register Sign In |