Handle return data
Syntax
Arguments
data
object
Data received from server.
callback
function
Contains calls of JavaScript functions that should be executed in series if received data is not erroneous.
Description
It evaluates return data from the server whether it contains an error or not. If it contains no error, callback function will be executed, else it will not be executed.
Example
The following program illustrates the function call where a Json String is passed as object for the parameter “data”:
The Server returns a Json String. After Client receives the Json String, it forwards it as input for the parameter “data” to the “$.response” function which evaluates it. If the passed Json String contains no error, the “alert” function will output it on the screen.
Last updated