Hi Allan,
I have tried debugger.
I am getting this:
Access to XMLHttpRequest at 'https://debug.datatables.net/submit.php' from origin 'http://localhost:51012' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
The problem is the JSON response has draw: 0. It should never be 0. This is used as a sequence number and Datatables starts with 1. The initial response should be 1. See the Server Side Processing docs for details of how to handle this parameter.
Are you using a Datatables supplied server side processing script? If so which one?
Replies
Ah, I see you've deleted it! This is the comment I was about to post there:
The only obvious things I can see is that some of those elements don't exist any more, such as
sAjaxSource
andfnServerData
- see https://datatables.net/manual/server-side#Legacy . It would be worth looking at the examples and the Ajax config options (such asajax
,ajax.data
andajax.dataSrc
),Colin
Sorry! but link you provided shows me "Discussion not found."
below is code I have also tried, in that code, not getting any error in console but table showing "Loading..." No error in ajax response.
Can you use the debugger to give me a trace please - click the Upload button and then let me know what the debug code is.
Even better would be if you can provide a link to the page.
Allan
Hi Allan,
I have tried debugger.
I am getting this:
Access to XMLHttpRequest at 'https://debug.datatables.net/submit.php' from origin 'http://localhost:51012' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Thank you for your help and guidance.
Hmmm - that's odd. I've just tried it and it works okay on a local IP address. I'll try localhost as well and see if that makes any difference.
For the time being, can you show me a screenshot from your browser's Network inspector showing the response from the server?
Allan
The problem is the JSON response has
draw: 0
. It should never be0
. This is used as a sequence number and Datatables starts with1
. The initial response should be1
. See the Server Side Processing docs for details of how to handle this parameter.Are you using a Datatables supplied server side processing script? If so which one?
Kevin
Thank you so much @kthorngren for pointing this.
its working fine now.
Thanks @allan @colin for your quick support.