The JSON standard (JavaScript Object Notation) is an open, text-based data format, designed for human-readable data interchange. Despite its descendance from JavaScript - you need JavaScript to process it, XSLT can't be used - it is language-independent. JSON is more lightweight than XML (about half the data) and therefore faster to process. Another advantage is that JSON is allowed in cross domain AJAX requests.
More general information about JSON can be found here:
A number of WebAPI commands have two optional JSON-specific arguments available: output
and callback
.
output
determines the output format to be returned. Besides XML, the JSON output format can be returned by wwwopac.ashx. JSON output is smaller than XML, so it may improve performance of your WebAPI application. Values for output
can be either json
or xml
(xml
is the default, so you don't need to specify that explicitly).
Although JSON is not XML, output=json
can be used together with the xmltype
argument: if xmltype
is set to grouped
, the JSON output will be grouped, and for xmltype=unstructured
the JSON output will be unstructured.
The output format produced by jQuery applications is always JSON, so you don't need to specify the output type there.
callback
returns JSON output wrapped in brackets with your callback function name, for AJAX requests: <callback function name>( <JSON output> ); You don't need to specify output=json
, because the output format is JSON by default.