Server processing - AJAX get fails

Server processing - AJAX get fails

dpanscikdpanscik Posts: 202Questions: 47Answers: 0
edited July 2 in General

I am certainly having a list of technical difficulties that I did not have previously on a previous setup of datatables.

When serverSide is set to false the ajax GET request works.

When serverSide is set to true, the ajax GET fails. Any ideas what might be causing this?

Answers

  • kthorngrenkthorngren Posts: 21,315Questions: 26Answers: 4,948

    You are getting 404 not found. Meaning the web server couldn't find the route to the target. You will need to look at the web server logs to find out why its responding with 404 error.

    A couple typical problems found on the forum:

    1. The _={timestamp} tacked onto the URL to prevent the browser from caching the page. The web server might not understand how to handle _={timestamp}. See the jQuery ajax docs for details. With SSP disable the Ajax request still sends the _={timestamp} so the web server appears to process it. This might not be the issue but something to look at.
    2. The URL is too long due to the query string parameters. There might be a setting in the web server to allow longer URLs. Or you will need to use POST requests to move the parameters into the request payload.

    Kevin

  • dpanscikdpanscik Posts: 202Questions: 47Answers: 0

    Switching the ajax to POST fixed the issue. I never realized GET had a string limitation smaller than POST. Learned something new...

  • kthorngrenkthorngren Posts: 21,315Questions: 26Answers: 4,948

    The difference is GET places the parameters in the URL. POST places the parameters within the payload of the request, not part of the URL.

    Kevin

Sign In or Register to comment.