This method can be used to retrieve a JSON result sending data to the server via POST encoding. This method works just like jQuery's native $.getJSON(), but uses POST to send the data parameters.

$.fn.postJSON = function(url, data, cb, ecb, opt)

Parameters

url
The URL to invoke with the request. Url can include query string values.

data
Either a string of raw POST data, or an object map of values that are turned into POST variables.

For example: { name: "Rick",total:"5.99" } is serialized into two POST variables named name and total with values of Rick and 5.99 as strings.

cb and ecb
These are the callback and error callback respectively. The callback receives the result data from the server, the error callback an error object with a message property.

opt
These are HttpClient options. The ones that are applied by this function are:

var options = { method: "POST", contentType: "application/x-www-form-urlencoded", noPostEncoding: true, evalResult: true }