...
This JavaScript class provides simple way to make Ajax requests with maximum flexibility. This class provides three-parameters - Methods, Params, and URL.
The structure of this class is as follows:
Code Block | ||
---|---|---|
| ||
cbx.ajax( { |
...
params : params, |
...
success : function(result) { |
...
}, |
...
failure : function(result, request) { |
...
} |
...
URL:'/Someurl' |
...
}); |
Params: The params should typically contain the data to be submitted to Server along with the combination of Product, Sub Product, Function, and Action to route through the Canvas default flow.
Success and Failure: These are the methods that handle the successful and unsuccessful submission of request.
URL: This is optional attribute. If URL is not provided, the request redirects to Canvas's WidgetControllerServlet.