Function Namespace kocujILV12aCAllJsAjax
kocujILV12aCAllJsAjax
Defined in: js-ajax.js.
Constructor Attributes | Constructor Name and Description |
---|---|
AJAX prototype constructor
|
Field Attributes | Field Name and Description |
---|---|
<private> |
Object kocujILV12aHelper
|
<private> |
Projects list
|
<private> |
Current script filename
|
<private> |
Script settings - AJAX URL
|
<private> |
Script settings - proxy can be used (true) or not (false)
|
<private> |
Script settings - prefix
|
<private> |
Script settings - security string
|
<private> |
Script settings - throw errors (true) or not (false)
|
Method Attributes | Method Name and Description |
---|---|
<private> |
_checkAddProject(projectId)
Check arguments for adding project
|
<private> |
_deactivateTimer(projectId, connectionId)
Deactivate timer
|
<private> |
_error(projectId, connectionId, isProxy, callbackError, callbackRetryWait, callbackRetryNow, sendMethodArguments, obj, status, err)
AJAX loading error
|
<private> |
_parseProjectId(projectId)
Parse project identifier
|
<private> |
_success(projectId, connectionId, isProxy, callbackSuccess, data, status, obj)
AJAX loading success
|
<private> |
_throwError(codeString, param)
Throw an error if debugging is enabled
|
addProject(projectId)
Add project
|
|
addProjectIfNotExists(projectId)
Add project if not exists
|
|
send(projectId, connectionId, url, method, dataType, data, callbacks)
Send AJAX request
|
|
sendGet(projectId, connectionId, url, dataType, data, callbacks)
Send AJAX request with GET method
|
|
sendJson(projectId, connectionId, url, data, callbacks)
Send AJAX request with JSON data
|
|
sendPost(projectId, connectionId, url, dataType, data, callbacks)
Send AJAX request with POST method
|
Field Detail
<private>
_objHelper
Object kocujILV12aHelper
<private>
_prj
Projects list
<private>
_thisFilename
Current script filename
<private>
_valsAjaxUrl
Script settings - AJAX URL
<private>
_valsCanUseProxy
Script settings - proxy can be used (true) or not (false)
<private>
_valsPrefix
Script settings - prefix
<private>
_valsSecurity
Script settings - security string
<private>
_valsThrowErrors
Script settings - throw errors (true) or not (false)
Method Detail
<private>
{Object}
_checkAddProject(projectId)
Check arguments for adding project
- Parameters:
- {string} projectId
- Project identifier
- Throws:
- {kocujILV12aCException}
- kocujILV12aExceptionCode.EMPTY_PROJECT_ID if project identifier entered in projectId is empty
- Returns:
- {Object} Parsed arguments for adding project
<private>
{void}
_deactivateTimer(projectId, connectionId)
Deactivate timer
- Parameters:
- {string} projectId
- Project identifier
- {string} connectionId
- Connection identifier
- Returns:
- {void}
<private>
{void}
_error(projectId, connectionId, isProxy, callbackError, callbackRetryWait, callbackRetryNow, sendMethodArguments, obj, status, err)
AJAX loading error
- Parameters:
- {string} projectId
- Project identifier
- {string} connectionId
- Connection identifier
- {boolean} isProxy
- AJAX has been sent through proxy (true) or directly (false)
- {function} callbackError
- Callback function for AJAX error
- {function} callbackRetryWait
- Callback function for doing something before waiting for AJAX request retry
- {function} callbackRetryNow
- Callback function for doing something at the beginning of AJAX request retry
- {Array} sendMethodArguments
- Argument for method send() which are used when there is trying to connect again
- {Object} obj
- Request object
- {string} status
- Text status
- {string} err
- Error
- Returns:
- {void}
<private>
{string}
_parseProjectId(projectId)
Parse project identifier
- Parameters:
- {string} projectId
- Project identifier
- Throws:
- {kocujILV12aCException}
- kocujILV12aExceptionCode.EMPTY_PROJECT_ID if project identifier entered in projectId is empty
- {kocujILV12aCException}
- kocujILV12aExceptionCode.PROJECT_DOES_NOT_EXIST if project identifier entered in projectId does not exist
- Returns:
- {string} Parsed project identifier
<private>
{void}
_success(projectId, connectionId, isProxy, callbackSuccess, data, status, obj)
AJAX loading success
- Parameters:
- {string} projectId
- Project identifier
- {string} connectionId
- Connection identifier
- {boolean} isProxy
- AJAX has been sent through proxy (true) or directly (false)
- {function} callbackSuccess
- Callback function for AJAX success
- {anything} data
- Data
- {string} status
- Text status
- {Object} obj
- Request object
- Returns:
- {void}
<private>
{void}
_throwError(codeString, param)
Throw an error if debugging is enabled
- Parameters:
- {string} codeString
- Error code in string format
- {string} param Optional
- Parameter for error information
- Returns:
- {void}
{void}
addProject(projectId)
Add project
- Parameters:
- {string} projectId
- Project identifier
- Throws:
- {kocujILV12aCException}
- kocujILV12aExceptionCode.PROJECT_ALREADY_EXISTS if project identifier entered in projectId already exists
- Returns:
- {void}
{void}
addProjectIfNotExists(projectId)
Add project if not exists
- Parameters:
- {string} projectId
- Project identifier
- Returns:
- {void}
{void}
send(projectId, connectionId, url, method, dataType, data, callbacks)
Send AJAX request
- Parameters:
- {string} projectId
- Project identifier
- {string} connectionId
- Connection identifier
- {string} url
- URL
- {string} method
- Request method
- {string} dataType
- Data type
- {Object} data Optional
- Data to send
- {Object} callbacks Optional
- Callback functions for AJAX request; there are the following callbacks available: error (when there was an error with request), retryWait (when there will be a retring of connection after a few seconds), retryNow (when there will be a retring of connection now), success (when there was a success)
- Returns:
- {void}
{void}
sendGet(projectId, connectionId, url, dataType, data, callbacks)
Send AJAX request with GET method
- Parameters:
- {string} projectId
- Project identifier
- {string} connectionId
- Connection identifier
- {string} url
- URL
- {string} dataType
- Data type
- {Object} data Optional
- Data to send
- {Object} callbacks Optional
- Callback functions for AJAX request; there are the following callbacks available: error (when there was an error with request), retryWait (when there will be a retring of connection after a few seconds), retryNow (when there will be a retring of connection now), success (when there was a success)
- Returns:
- {void}
{void}
sendJson(projectId, connectionId, url, data, callbacks)
Send AJAX request with JSON data
- Parameters:
- {string} projectId
- Project identifier
- {string} connectionId
- Connection identifier
- {string} url
- URL
- {Object} data Optional
- Data to send
- {Object} callbacks Optional
- Callback functions for AJAX request; there are the following callbacks available: error (when there was an error with request), retryWait (when there will be a retring of connection after a few seconds), retryNow (when there will be a retring of connection now), success (when there was a success)
- Returns:
- {void}
{void}
sendPost(projectId, connectionId, url, dataType, data, callbacks)
Send AJAX request with POST method
- Parameters:
- {string} projectId
- Project identifier
- {string} connectionId
- Connection identifier
- {string} url
- URL
- {string} dataType
- Data type
- {Object} data Optional
- Data to send
- {Object} callbacks Optional
- Callback functions for AJAX request; there are the following callbacks available: error (when there was an error with request), retryWait (when there will be a retring of connection after a few seconds), retryNow (when there will be a retring of connection now), success (when there was a success)
- Returns:
- {void}