Class Index | File Index

Classes


Namespace aV.AJAX

Represents the namespace, aV.AJAX, for the core AJAX functions and global parameters of those functions.
Defined in: aV.main.ajax.js.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
Represents the namespace, aV.AJAX, for the core AJAX functions and global parameters of those functions.
Field Summary
Field Attributes Field Name and Description
<static>  
The current active requests number.
Method Summary
Method Attributes Method Name and Description
<static>  
This function is assigned to the page's onbeforeunload event for pageLeaveWarning feature.
<static>  
Tries to get an XMLHttpRequest object, returns false if the browser does not support AJAX.
<static>  
aV.AJAX.destroyRequestObject(requestObject)
Destroys the given XMLHttpRequest object safely.
<static>  
aV.AJAX.loadContent(theURL, element, completedFunction, loadingFunction)
Loads content to the given container element using an asynchronous HTTP GET call.
<static>  
aV.AJAX.loadResource(theURL, type, resourceId, forceRefresh)
Loads an external style-sheet or Javascript file on-demand.
<static>  
aV.AJAX.makeGetRequest(adress, changeFunction)
Creates a new XMLHttpRequest object which connects to the adress, which includes the URI encoded and merged GET parameters.
<static>  
aV.AJAX.makePostRequest(adress, parameters, changeFunction)
Creates a new XMLHttpRequest object which posts the given URI query string to the given adress.
<static>  
aV.AJAX.makeRequest(method, adress, parameters, completedFunction, loadingFunction)
Takes "GET" or "POST" as method parameter and then according to this, creates a SELF-MANAGED XMLHttpRequest object using internal makeGetRequest or makePostRequest according to the method parameter.
<static>  
aV.AJAX.sendForm(event)
Sends the form data using AJAX when the form's onSubmit event is triggered.
<static>  
aV.AJAX.serializeParameters(parameters, format)
This function serializes the parameters object to a standart URI query string.
Namespace Detail
aV.AJAX
Represents the namespace, aV.AJAX, for the core AJAX functions and global parameters of those functions.
Parameters:
{String} config.noAjax Optional, Default: "You need an AJAX supported browser to use this page."
The error message which user will see if his/her browser does not support AJAX. If you want to disable this warning, just set this to false.
{String} config.loadImgPath Optional, Default: "images/loading_img.gif"
The "loading" gif's path, which might be used in various places.
{String} config.loadingText Optional
The "loading" message which will be placed into a dynamically filled container while the content is being loaded. If you want to disable this text, just set this to false.
{String} config.pageLeaveWarning Optional, Default: "There are one or more requests in progress. If you exit, there might be data loss."
The warning message which will be displayed to user if (s)he tries to leave the page while an AJAX request is loading. If you want to disable this warning, just set this to false.
Field Detail
<static> {integer} aV.AJAX.activeRequestCount
The current active requests number. Changing this value is highly discouraged.
Method Detail
<static> {String | null} aV.AJAX.checkActiveRequests()
This function is assigned to the page's onbeforeunload event for pageLeaveWarning feature. See aV.AJAX.config.pageLeaveWarning
Deprecated:
Should not be called directly, it is for the page's onbeforeunload event.
Returns:
{String | null} pageLeaveWarning config variable or null

<static> {XMLHttpRequestObject | false} aV.AJAX.createRequestObject()
Tries to get an XMLHttpRequest object, returns false if the browser does not support AJAX.
Deprecated:
You should not need to use this function directly, use {@link aV.AJAX.makeRequest} to make AJAX calls.
Returns:
{XMLHttpRequestObject | false} A new XMLHttpRequest object or false

<static> aV.AJAX.destroyRequestObject(requestObject)
Destroys the given XMLHttpRequest object safely. Aborts the request if it is active.
Parameters:
{XMLHttpRequestObject} requestObject
The requestObject which will be destroyed

<static> aV.AJAX.loadContent(theURL, element, completedFunction, loadingFunction)
Loads content to the given container element using an asynchronous HTTP GET call. If the config.loadingText is defined, target container element's innerHTML is filled with its valye while the content is loading.
Parameters:
{String} theURL
The URL of the content which will be loaded dynamically into the given container.
{String|Object} element
The container element itself or its id, which the dynamic content will be loaded into.
{Function(Object|String)} completedFunction Optional
The function which will be called when the loading of the content is finished. It is called with the target container element and the URL as parameters.
{Function(Object|String)} loadingFunction Optional
The function which will be called EVERYTIME when an onreadystatechange event is occured with a readyState different than 4 while loading the dynamic content. It is called with the target container element and the URL as parameters.

<static> {HTMLElementObject} aV.AJAX.loadResource(theURL, type, resourceId, forceRefresh)
Loads an external style-sheet or Javascript file on-demand. Removes the old node if a resourceId is given.
Parameters:
{String} theURL
The address of the resource-to-be-loaded.
{String} type Optional, Default: "js"
The type of the resource. Should be either js or css.
{String} resourceId Optional
The id which will be assigned to newly created DOM node. If not given, no id is assigned to the created node.
{Boolean} forceRefresh Optional
Addes a "?time" value at the end of the file URL to force the browser reload the file and not to use cache.
Returns:
{HTMLElementObject} The newly added script or link DOM node.

<static> {XMLHttpRequestObject} aV.AJAX.makeGetRequest(adress, changeFunction)
Creates a new XMLHttpRequest object which connects to the adress, which includes the URI encoded and merged GET parameters. Assignes changeFunction to the newly created XMLHttpRequest object's onreadystatechange event. Frees the XMLHttpRequest object automatically after completing the call.
Parameters:
{String} adress
The adress of the page which will be connected. Should include the URI encoded GET parameters.
{Function(XMLHttpRequestObject)} changeFunction Optional
The function which will be assigned to the newly created XMLHttpRequest object's onreadystatechange event.
Deprecated:
Generally used internally from other high-level functions. Not very suitable for end-developers.
Returns:
{XMLHttpRequestObject}

<static> {XMLHttpRequestObject} aV.AJAX.makePostRequest(adress, parameters, changeFunction)
Creates a new XMLHttpRequest object which posts the given URI query string to the given adress. Assignes changeFunction to the newly created XMLHttpRequest object's onreadystatechange event. Frees the XMLHttpRequest object automatically after completing the call.
Parameters:
{String} adress
The adress of the page which will be connected. Should NOT include any parameters.
{String} parameters
The URI encoded and merged POST parameters for the HTTP request.
{Function(XMLHttpRequestObject)} changeFunction Optional
The function which will be assigned to the newly created XMLHttpRequest object's onreadystatechange event.
Deprecated:
Generally used internally from other high-level functions. Not very suitable for end-developers.
Returns:
{XMLHttpRequestObject}

<static> {XMLHttpRequestObject} aV.AJAX.makeRequest(method, adress, parameters, completedFunction, loadingFunction)
Takes "GET" or "POST" as method parameter and then according to this, creates a SELF-MANAGED XMLHttpRequest object using internal makeGetRequest or makePostRequest according to the method parameter. Developers are strongly recommended to use THIS function instead of the above POST and GET specific functions.
Parameters:
{String} method
Should be either POST or GET according to the type of the HTTP request.
{String} adress
The adress of the page which will be connected. Should NOT include any parameters.
{String | Object} parameters
The parameters which are either URI encoded and merged or given in the JSON format
{Function(XMLHttpRequestObject)} completedFunction Optional
The function which will be called when the HTTP call is completed. (readyState==4)
{Function(XMLHttpRequestObject)} loadingFunction Optional
The function which will be called EVERYTIME when an onreadystatechange event is occured with a readyState different than 4. Might be called several times before the call is completed.
Returns:
{XMLHttpRequestObject} The newly created XMLHttpRequest object for this specific AJAX call.

<static> {Boolean} aV.AJAX.sendForm(event)
Sends the form data using AJAX when the form's onSubmit event is triggered.
Parameters:
{Object} event
Returns:
{Boolean} Returns always false to prevent "real" submission.

<static> {String} aV.AJAX.serializeParameters(parameters, format)
This function serializes the parameters object to a standart URI query string.
Parameters:
{Object} parameters
format
Returns:
{String} The URI query string.

Documentation generated by JsDoc Toolkit 2.0.1 on Sun Aug 03 2008 14:14:38 GMT+0300 (EEST)