JSONP is a method to allow the
use of JSON data from any server (this allows for the XSS protection that browsers use when loading Ajax data
from a remote source). Using JSONP allows DataTables to load server-side sourced data from any domain and is
quite simply done with the dataType
option of the ajax
initialisation option.
When given as an object, the ajax
option maps directly
onto the jQuery ajax options (i.e. any option that can be used
in jQuery's Ajax function can also be used in DataTable's ajax
option).
The example below shows ajax
being used with the
dataType
option set to retrieve JSONP data for server-side processing in DataTables.
Name | Age | Position | Office | Start date | Salary |
---|---|---|---|---|---|
Name | Age | Position | Office | Start date | Salary |