What exactly is the sAjaxSource parameter in datatables? What exactly is the sAjaxSource parameter in datatables? json json

What exactly is the sAjaxSource parameter in datatables?


In server-side processing you can choose either of two ways:

  1. Serve JSON from the same URL, which you use to show HTML page with a table(page with table is on www.example.com/table and AJAX call to www.example.com/?sEcho=1&andOtherParametersHere) - you do not need specify sAjaxSource, because datatable's script joins the parameters to the existing URL.

  2. Serve JSON from URL that is different from one you use to show HTML page with table(so page with table is on www.example.com/table and AJAX call to www.another.com/?sEcho=1&andOtherParametersHere) - you must specify sAjaxSource to www.another.com.


Simply put, it's the URL that returns your DataTables content that you want to display (your data source for server-side processing).

If you need more details, there are plenty of links in the other replies that detail it.