Methods
(static) get(path, params, function, function) → {jQueryPromise}
Run a jQuery ajax.get with the configured host for the specified path with given params.
Runs
Parameters:
Name | Type | Description |
---|---|---|
path |
string | Required. The endpoint for the ajax query |
params |
Hash | Optional. Hash of params to pass to the get call |
function |
success | Optional. function to call with response object from successful call. If not present, just returns the repsonse object value. |
function |
failure | Optional. function to call with the error object from a failed call. If not present, logs the error and returns the error object value. |
Returns:
A promise that either returns the response/error or calls the passed callbacks.
- Type
- jQueryPromise
(static) getJson(path, params, jsonCallback, function, function) → {jQueryPromise}
Run a jQuery ajax.get with the configured host for jsonp call.
Runs
Parameters:
Name | Type | Default | Description |
---|---|---|---|
path |
string | Required. The endpoint for the jsonp service | |
params |
Hash | Optional. Hash of params to pass to the get call | |
jsonCallback |
Hash | jsonCallback | jsonpCallback function |
function |
success | Optional. function to call with response object from successful call. If not present, just returns the repsonse object value. | |
function |
failure | Optional. function to call with the error object from a failed call. If not present, logs the error and returns the error object value. |
Returns:
A promise that either returns the response/error or calls the passed callbacks.
- Type
- jQueryPromise