xajax_core.jsThis file contains the definition of the main xajax javascript core. This is the client side code which runs on the web browser or similar web enabled application. Include this in the HEAD of each page for which you wish to use xajax. Summary | This file contains the definition of the main xajax javascript core. | | Please see copyright.inc.php for a detailed description, copyright and license information. | | This class contains all the default configuration settings. | | | | This function will set a default configuration option if it is not already set. | | | | | | | | The base document that will be used throughout the code for locating elements by ID. | | The URI that requests will be sent to. | | | | The Hyper Text Transport Protocol version designated in the header of the request. | | The content type designated in the header of the request. | | The delay time, in milliseconds, associated with the <xajax.callback.global.onRequestDelay> event. | | The amount of time to wait, in milliseconds, before a request is considered expired. | | The method used to send requests to the server. | | The number of times a request should be retried if it expires. | | The value returned by xajax.call when in asynchronous mode, or when a syncrhonous call does not specify the return value. | | The maximum depth of recursion allowed when serializing objects to be sent to the server in a request. | | The maximum number of members allowed when serializing objects to be sent to the server in a request. | | Provides support for updating the browser’s status bar during the request process. | | | | Constructs and returns a set of event handlers that will be called by the xajax framework to set the status bar messages. | | Constructs and returns a set of event handlers that will be called by the xajax framework where status bar updates would normally occur. | | Provides the base functionality for updating the browser’s cursor during requests. | | | | Constructs and returns a set of event handlers that will be called by the xajax framework to effect the status of the cursor during requests. | | Constructs and returns a set of event handlers that will be called by the xajax framework where cursor status changes would typically be made during the handling of requests. | | This contains utility functions which are used throughout the xajax core. | | | | Shorthand for finding a uniquely named element within the document. | | Replace all occurances of the single quote character with a double quote character. | | Replace all occurances of the double quote character with a single quote character. | | Determine if the specified value contains special characters and create a CDATA section so the value can be safely transmitted. | | Convert a javascript object or array into XML suitable for transmission to the server. | | Deserialize a javascript object from an XML node. | | Construct an XMLHttpRequest object dependent on the capabilities of the browser. | | Insert the specified string of HTML into the document, then extract it. | | Tests to see if the specified data is the same as the current value of the element’s attribute. | | Build an associative array of form elements and their values from the specified form. | | | | | | Detect, and if found, remove the prefix ‘on’ from the specified string. | | Detect, and add if not found, the prefix ‘on’ from the specified string. | | This contains the code and variables for building, populating and processing First In Last Out (FILO) buffers. | | | | Construct and return a new queue object. | | Maintains a retry counter for the given object. | | Rewind the buffer head pointer, effectively reinserting the last retrieved object into the buffer. | | Set or reset a timeout that is used to restart processing of the queue. | | While entries exist in the queue, pull and entry out and process it’s command. | | Push a new object into the tail of the buffer maintained by the specified queue object. | | Push a new object into the head of the buffer maintained by the specified queue object. | | Attempt to pop an object off the head of the queue. | | | | | | Parse the response XML into a series of commands. | | Contains the functions for javascript file and function manipulation. | | | | Add a reference to the specified script file if one does not already exist in the HEAD of the current document. | | Adds a SCRIPT tag referencing the specified file. | | Locates a SCRIPT tag in the HEAD of the document which references the specified file and removes it. | | Causes the processing of items in the queue to be delayed for the specified amount of time. | | Prompt the user with the specified text, if the user responds by clicking cancel, then skip the specified number of commands in the response command queue. | | Execute the specified string of javascript code, using the current script context. | | Test for the specified condition, using the current script context; if the result is false, sleep for 1/10th of a second and try again. | | Call a javascript function with a series of parameters using the current script context. | | Constructs the specified function using the specified javascript as the body of the function. | | Construct a javascript function which will call the original function with the same name, potentially executing code before and after the call to the original function. | | Helper function used in the wrapping of an existing javascript function. | | | | | | Assign an element’s attribute to the specified value. | | Append the specified value to an element’s attribute. | | Prepend the specified value to an element’s attribute. | | Search and replace the specified text. | | | | Create a new element and append it to the specified parent element. | | Insert a new element before the specified element. | | Insert a new element after the specified element. | | Assign a value to a named member of the current script context object. | | Appends a value to a named member of the current script context object. | | Prepend a value to a named member of the current script context object. | | | | | | Add a LINK reference to the specified .css file if it does not already exist in the HEAD of the current document. | | Locate and remove a LINK reference from the current document’s HEAD. | | Attempt to detect when all .css files have been loaded once they are referenced by a LINK tag in the HEAD of the current document. | | | | | | Create and return a form input element with the specified parameters. | | Create a new input element under the specified parent. | | Insert a new input element before the specified element. | | Insert a new input element after the specified element. | | | | | | | | Add an event handler to the specified element. | | Remove an event handler from an element. | | | | | | Create a blank callback object. | | Create a timer to fire an event in the future. | | Clear a callback timer for the specified function. | | Execute a callback event. | | The global callback object which is active for every request. | | | | | | The response queue that holds response commands, once received from the server, until they are processed. | | This array contains a list of codes which will be returned from the server upon successful completion of the server portion of the request. | | This array contains a list of status codes returned by the server to indicate that the request failed for some reason. | | An array of status codes returned from the server to indicate a request for redirect to another URL. | | The array of command handlers that are currently available. | | | | Initialize a request object, populating default settings, where call specific settings are not already provided. | | Processes request specific parameters and generates the temporary variables needed by xajax to initiate and process the request. | | Prepares the XMLHttpRequest object for this xajax request. | | | | Initiates a call to the server. | | Create a request object and submit the request using the specified request type; all request parameters should be finalized by this point. | | This function is used internally by xajax to initiate a request to the server. | | | | | | This function attempts to determine, based on the content type of the reponse, what processor should be used for handling the response data. | | Take the parameters passed in the command of the XML response and convert them to parameters of the args object. | | Parses the child nodes of the command of the response XML. | | Perform a lookup on the command specified by the response command object passed in the first parameter. | | Called by the response command queue processor when all commands have been processed. | | | | | | | | | | Contains shortcut’s to frequently used functions. | | | | | | | | |
xajax core javascript libraryPlease see copyright.inc.php for a detailed description, copyright and license information.
xajax. configThis class contains all the default configuration settings. These are application level settings; however, they can be overridden by including a xajax.config definition prior to including the xajax_core.js file, or by specifying the appropriate configuration options on a per call basis. Summary | | | This function will set a default configuration option if it is not already set. | | | | | | | | The base document that will be used throughout the code for locating elements by ID. | | The URI that requests will be sent to. | | | | The Hyper Text Transport Protocol version designated in the header of the request. | | The content type designated in the header of the request. | | The delay time, in milliseconds, associated with the <xajax.callback.global.onRequestDelay> event. | | The amount of time to wait, in milliseconds, before a request is considered expired. | | The method used to send requests to the server. | | The number of times a request should be retried if it expires. | | The value returned by xajax.call when in asynchronous mode, or when a syncrhonous call does not specify the return value. | | The maximum depth of recursion allowed when serializing objects to be sent to the server in a request. | | The maximum number of members allowed when serializing objects to be sent to the server in a request. |
setDefaultxajax.config.setDefault = function( | option, | | defaultValue | ) |
|
This function will set a default configuration option if it is not already set. option | (string): The name of the option that will be set. | defaultValue | (unknown): The value to use if a value was not already set. |
waitCursorxajax.config.setDefault( | 'waitCursor', | | false | ) |
|
true | xajax should display a wait cursor when making a request | false | xajax should not show a wait cursor during a request |
statusMessagesxajax.config.setDefault( | 'statusMessages', | | false | ) |
|
true | xajax should update the status bar during a request | false | xajax should not display the status of the request |
baseDocumentxajax.config.setDefault( | 'baseDocument', | | document | ) |
|
The base document that will be used throughout the code for locating elements by ID.
requestURIxajax.config.setDefault( | 'requestURI', | | xajax.config.baseDocument.URL | ) |
|
The URI that requests will be sent to.
defaultModexajax.config.setDefault( | 'defaultMode', | | 'asynchronous' | ) |
|
The request mode. ’asynchronous’ | The request will immediately return, the response will be processed when (and if) it is received. | ’synchronous’ | The request will block, waiting for the response. This option allows the server to return a value directly to the caller. |
defaultHttpVersionxajax.config.setDefault( | 'defaultHttpVersion', | | 'HTTP/1.1' | ) |
|
The Hyper Text Transport Protocol version designated in the header of the request.
defaultContentTypexajax.config.setDefault( | 'defaultContentType', | | 'application/x-www-form-urlencoded' | ) |
|
The content type designated in the header of the request.
defaultResponseDelayTimexajax.config.setDefault( | 'defaultResponseDelayTime', | | 1000 | ) |
|
The delay time, in milliseconds, associated with the <xajax.callback.global.onRequestDelay> event.
defaultExpirationTimexajax.config.setDefault( | 'defaultExpirationTime', | | 10000 | ) |
|
The amount of time to wait, in milliseconds, before a request is considered expired. This is used to trigger the <xajax.callback.global.onExpiration event.
defaultMethodxajax.config.setDefault( | 'defaultMethod', | | 'POST' | ) |
|
The method used to send requests to the server. ’POST’ | Generate a form POST request | ’GET’ | Generate a GET request; parameters are appended to the xajax.config.requestURI to form a URL. |
defaultRetryxajax.config.setDefault( | 'defaultRetry', | | 5 | ) |
|
The number of times a request should be retried if it expires.
defaultReturnValuexajax.config.setDefault( | 'defaultReturnValue', | | false | ) |
|
The value returned by xajax.call when in asynchronous mode, or when a syncrhonous call does not specify the return value.
maxObjectDepthxajax.config.setDefault( | 'maxObjectDepth', | | 20 | ) |
|
The maximum depth of recursion allowed when serializing objects to be sent to the server in a request.
maxObjectSizexajax.config.setDefault( | 'maxObjectSize', | | 2000 | ) |
|
The maximum number of members allowed when serializing objects to be sent to the server in a request.
xajax. config. statusProvides support for updating the browser’s status bar during the request process. By splitting the status bar functionality into an object, the xajax developer has the opportunity to customize the status bar messages prior to sending xajax requests. Summary | | | Constructs and returns a set of event handlers that will be called by the xajax framework to set the status bar messages. | | Constructs and returns a set of event handlers that will be called by the xajax framework where status bar updates would normally occur. |
updateConstructs and returns a set of event handlers that will be called by the xajax framework to set the status bar messages.
dontUpdateConstructs and returns a set of event handlers that will be called by the xajax framework where status bar updates would normally occur.
xajax. config. cursorProvides the base functionality for updating the browser’s cursor during requests. By splitting this functionalityh into an object of it’s own, xajax developers can now customize the functionality prior to submitting requests. Summary | | | Constructs and returns a set of event handlers that will be called by the xajax framework to effect the status of the cursor during requests. | | Constructs and returns a set of event handlers that will be called by the xajax framework where cursor status changes would typically be made during the handling of requests. |
updateConstructs and returns a set of event handlers that will be called by the xajax framework to effect the status of the cursor during requests.
dontUpdateConstructs and returns a set of event handlers that will be called by the xajax framework where cursor status changes would typically be made during the handling of requests.
xajax. toolsThis contains utility functions which are used throughout the xajax core. Summary | | | Shorthand for finding a uniquely named element within the document. | | Replace all occurances of the single quote character with a double quote character. | | Replace all occurances of the double quote character with a single quote character. | | Determine if the specified value contains special characters and create a CDATA section so the value can be safely transmitted. | | Convert a javascript object or array into XML suitable for transmission to the server. | | Deserialize a javascript object from an XML node. | | Construct an XMLHttpRequest object dependent on the capabilities of the browser. | | Insert the specified string of HTML into the document, then extract it. | | Tests to see if the specified data is the same as the current value of the element’s attribute. | | Build an associative array of form elements and their values from the specified form. | | | | | | Detect, and if found, remove the prefix ‘on’ from the specified string. | | Detect, and add if not found, the prefix ‘on’ from the specified string. |
$xajax.tools.$ = function( | sId | ) |
|
Shorthand for finding a uniquely named element within the document. sId | (string): The unique name of the element (specified by the ID attribute), not to be confused with the name attribute on form elements. |
Returnsobject | The element found or null. |
NoteThis function uses the xajax.config.baseDocument which allows xajax to operate on the main window document as well as documents from contained iframes and child windows. See alsoxajax.$ and xjx.$
doubleQuotesxajax.tools.doubleQuotes = function( | haystack | ) |
|
Replace all occurances of the single quote character with a double quote character. haystack | The source string to be scanned. |
Returnsstring | A new string with the modifications applied. |
singleQuotesxajax.tools.singleQuotes = function( | haystack | ) |
|
Replace all occurances of the double quote character with a single quote character. haystack | The source string to be scanned. |
Returnsstring | A new string with the modification applied. |
_escapexajax.tools._escape = function( | data | ) |
|
Determine if the specified value contains special characters and create a CDATA section so the value can be safely transmitted. data | (string or other): The source string value to be evaluated or an object of unknown type. |
Returnsstring | The string value, escaped if necessary or the object provided if it is not a string. |
NoteWhen the specified object is NOT a string, the value is returned as is.
_objectToXMLxajax.tools._objectToXML = function( | obj, | | guard | ) |
|
Convert a javascript object or array into XML suitable for transmission to the server. obj | The object or array to convert. | guard | An object used to track the level of recursion when encoding javascript objects. When an object contains a reference to it’s parent and the parent contains a reference to the child, an infinite recursion will cause some browsers to crash. |
Returnsstring | the xml representation of the object or array. |
See alsoxajax.config.maxObjectDepth and xajax.config.maxObjectSize
_nodeToObjectxajax.tools._nodeToObject = function( | node | ) |
|
Deserialize a javascript object from an XML node. node | A node, likely from the xml returned by the server. |
Returnsobject | The object extracted from the xml node. |
getRequestObjectConstruct an XMLHttpRequest object dependent on the capabilities of the browser. Returnsobject | Javascript XHR object. |
getBrowserHTMLxajax.tools.getBrowserHTML = function( | sValue | ) |
|
Insert the specified string of HTML into the document, then extract it. This gives the browser the ability to validate the code and to apply any transformations it deems appropriate. sValue | (string): A block of html code or text to be inserted into the browser’s document. |
ReturnsThe (potentially modified) html code or text.
willChangexajax.tools.willChange = function( | element, | | attribute, | | newData | ) |
|
Tests to see if the specified data is the same as the current value of the element’s attribute. element | (string or object): The element or it’s unique name (specified by the ID attribute) | attribute | (string): The name of the attribute. | newData | (string): The value to be compared with the current value of the specified element. |
Returnstrue | The specified value differs from the current attribute value. | false | The specified value is the same as the current value. |
getFormValuesxajax.tools.getFormValues = function( | parent | ) |
|
Build an associative array of form elements and their values from the specified form. element | (string): The unique name (id) of the form to be processed. | disabled | (boolean, optional): Include form elements which are currently disabled. | prefix | (string, optional): A prefix used for selecting form elements. |
ReturnsAn associative array of form element id and value.
_getFormValuesxajax.tools._getFormValues = function( | aFormValues, | | children, | | submitDisabledElements, | | prefix | ) |
|
Used internally by xajax.tools.getFormValues to recursively get the value of form elements. This function will extract all form element values regardless of the depth of the element within the form.
_getFormValuexajax.tools._getFormValue = function( | aFormValues, | | child, | | submitDisabledElements, | | prefix | ) |
|
Used internally by xajax.tools._getFormValues to extract a single form value. This will detect the type of element (radio, checkbox, multi-select) and add it’s value(s) to the form values array.
stripOnPrefixxajax.tools.stripOnPrefix = function( | sEventName | ) |
|
Detect, and if found, remove the prefix ‘on’ from the specified string. This is used while working with event handlers. sEventName | (string): The string to be modified. |
Returnsstring | The modified string. |
addOnPrefixxajax.tools.addOnPrefix = function( | sEventName | ) |
|
Detect, and add if not found, the prefix ‘on’ from the specified string. This is used while working with event handlers. sEventName | (string): The string to be modified. |
Returnsstring | The modified string. |
xajax. tools. queueThis contains the code and variables for building, populating and processing First In Last Out (FILO) buffers. Summary | | | Construct and return a new queue object. | | Maintains a retry counter for the given object. | | Rewind the buffer head pointer, effectively reinserting the last retrieved object into the buffer. | | Set or reset a timeout that is used to restart processing of the queue. | | While entries exist in the queue, pull and entry out and process it’s command. | | Push a new object into the tail of the buffer maintained by the specified queue object. | | Push a new object into the head of the buffer maintained by the specified queue object. | | Attempt to pop an object off the head of the queue. |
createxajax.tools.queue.create = function( | size | ) |
|
Construct and return a new queue object. size | (integer): The number of entries the queue will be able to hold. |
retryxajax.tools.queue.retry = function( | obj, | | count | ) |
|
Maintains a retry counter for the given object. obj | (object): The object to track the retry count for. | count | (integer): The number of times the operation should be attempted before a failure is indicated. |
Returnstrue | The object has not exhausted all the retries. | false | The object has exhausted the retry count specified. |
rewindxajax.tools.queue.rewind = function( | theQ | ) |
|
Rewind the buffer head pointer, effectively reinserting the last retrieved object into the buffer. theQ | (object): The queue to be rewound. |
setWakeupxajax.tools.queue.setWakeup = function( | theQ, | | when | ) |
|
Set or reset a timeout that is used to restart processing of the queue. This allows the queue to asynchronously wait for an event to occur (giving the browser time to process pending events, like loading files) theQ | (object): The queue to process upon timeout. | when | (integer): The number of milliseconds to wait before starting/ restarting the processing of the queue. |
processxajax.tools.queue.process = function( | theQ | ) |
|
While entries exist in the queue, pull and entry out and process it’s command. When a command returns false, the processing is halted. Returnstrue | The queue was fully processed and is now empty. | false | The queue processing was halted before the queue was fully processed. |
Notes- Use xajax.tools.queue.setWakeup or call this function to cause the queue processing to continue.
- This will clear the associated timeout, this function is not designed to be reentrant.
- When an exception is caught, do nothing; if the debug module is installed, it will catch the exception and handle it.
pushxajax.tools.queue.push = function( | theQ, | | obj | ) |
|
Push a new object into the tail of the buffer maintained by the specified queue object. theQ | (object): The queue in which you would like the object stored. | obj | (object): The object you would like stored in the queue. |
pushFrontxajax.tools.queue.pushFront = function( | theQ, | | obj | ) |
|
Push a new object into the head of the buffer maintained by the specified queue object. This effectively pushes an object to the front of the queue... it will be processed first. theQ | (object): The queue in which you would like the object stored. | obj | (object): The object you would like stored in the queue. |
popxajax.tools.queue.pop = function( | theQ | ) |
|
Attempt to pop an object off the head of the queue. theQ | (object): The queue object you would like to modify. |
Returnsobject | The object that was at the head of the queue or null if the queue was empty. |
xajax. responseProcessorSummary | | | Parse the response XML into a series of commands. |
xmlxajax.responseProcessor.xml = function( | oRequest | ) |
|
Parse the response XML into a series of commands. The commands are constructed by calling xajax.parseAttributes and xajax.parseChildren. oRequest | (object): The request context object. |
xajax.jsContains the functions for javascript file and function manipulation. Summary | | | Add a reference to the specified script file if one does not already exist in the HEAD of the current document. | | Adds a SCRIPT tag referencing the specified file. | | Locates a SCRIPT tag in the HEAD of the document which references the specified file and removes it. | | Causes the processing of items in the queue to be delayed for the specified amount of time. | | Prompt the user with the specified text, if the user responds by clicking cancel, then skip the specified number of commands in the response command queue. | | Execute the specified string of javascript code, using the current script context. | | Test for the specified condition, using the current script context; if the result is false, sleep for 1/10th of a second and try again. | | Call a javascript function with a series of parameters using the current script context. | | Constructs the specified function using the specified javascript as the body of the function. | | Construct a javascript function which will call the original function with the same name, potentially executing code before and after the call to the original function. | | Helper function used in the wrapping of an existing javascript function. |
includeOnceAdd a reference to the specified script file if one does not already exist in the HEAD of the current document. This will effecitvely cause the script file to be loaded in the browser. fileName | (string): The URI of the file. |
Returnstrue | The reference exists or was added. |
includeScriptxajax.js.includeScript = function( | fileName | ) |
|
Adds a SCRIPT tag referencing the specified file. This effectively causes the script to be loaded in the browser. fileName | (string): The URI of the file. |
Returnstrue | The reference was added. |
removeScriptxajax.js.removeScript = function( | fileName, | | unload | ) |
|
Locates a SCRIPT tag in the HEAD of the document which references the specified file and removes it. fileName | (string): The URI of the script file. | unload | (function, optional): The function to call just before the file reference is removed. This can be used to clean up objects that reference code from that script file. |
Returnstrue | The script was not found or was removed. |
sleepxajax.js.sleep = function( | args | ) |
|
Causes the processing of items in the queue to be delayed for the specified amount of time. This is an asynchronous operation, therefore, other operations will be given an opportunity to execute during this delay. args | (object): The response command containing the following parameters. |
- args.property: The number of 10ths of a second to sleep.
Returnstrue | The sleep operation completed. | false | The sleep time has not yet expired, continue sleeping. |
confirmCommandsxajax.js.confirmCommands = function( | msg, | | numberOfCommands | ) |
|
Prompt the user with the specified text, if the user responds by clicking cancel, then skip the specified number of commands in the response command queue. If the user clicks Ok, the command processing resumes normal operation. msg | (string): The message to display to the user. | numberOfCommands | (integer): The number of commands to skip if the user clicks Cancel. |
Returnstrue | The operation completed successfully. |
executexajax.js.execute = function( | args | ) |
|
Execute the specified string of javascript code, using the current script context. args | The response command object containing the following: |
- args.data: (string): The javascript to be evaluated.
- args.context: (object): The javascript object that to be referenced as ‘this’ in the script.
Returnsunknown | A value set by the script using ‘returnValue = ‘ | true | If the script does not set a returnValue. |
waitForxajax.js.waitFor = function( | args | ) |
|
Test for the specified condition, using the current script context; if the result is false, sleep for 1/10th of a second and try again. args | The response command object containing the following: |
- args.data: (string): The javascript to evaluate.
- args.property: (integer): The number of 1/10ths of a second to wait before giving up.
- args.context: (object): The current script context object which is accessable in the javascript being evaulated via the ‘this’ keyword.
Returnsfalse | The condition evaulates to false and the sleep time has not expired. | true | The condition evaluates to true or the sleep time has expired. |
callxajax.js.call = function( | args | ) |
|
Call a javascript function with a series of parameters using the current script context. args | The response command object containing the following: |
- args.data: (array): The parameters to pass to the function.
- args.func: (string): The name of the function to call.
- args.context: (object): The current script context object which is accessable in the function name via the ‘this’ keyword.
Returnstrue | The call completed successfully. |
setFunctionxajax.js.setFunction = function( | args | ) |
|
Constructs the specified function using the specified javascript as the body of the function. args | The response command object which contains the following: |
- args.func: (string): The name of the function to construct.
- args.data: (string): The script that will be the function body.
- args.context: (object): The current script context object which is accessable in the script name via the ‘this’ keyword.
Returnstrue | The function was constructed successfully. |
wrapFunctionxajax.js.wrapFunction = function( | args | ) |
|
Construct a javascript function which will call the original function with the same name, potentially executing code before and after the call to the original function. args | (object): The response command object which will contain the following: |
- args.func: (string): The name of the function to be wrapped.
- args.property: (string): List of parameters used when calling the function.
- args.data: (array): The portions of code to be called before, after or even between calls to the original function.
- args.context: (object): The current script context object which is accessable in the function name and body via the ‘this’ keyword.
Returnstrue | The wrapper function was constructed successfully. |
makeWrapperxajax.js.makeWrapper = function( | origFun, | | args, | | codeBlocks, | | returnVariable, | | context | ) |
|
Helper function used in the wrapping of an existing javascript function. origFun | (string): The name of the original function. | args | (string): The list of parameters used when calling the function. | codeBlocks | (array): Array of strings of javascript code to be executed before, after and perhaps between calls to the original function. | returnVariable | (string): The name of the variable used to retain the return value from the call to the original function. | context | (object): The current script context object which is accessable in the function name and body via the ‘this’ keyword. |
Returnsobject | The complete wrapper function. |
xajax.domSummary | | | Assign an element’s attribute to the specified value. | | Append the specified value to an element’s attribute. | | Prepend the specified value to an element’s attribute. | | Search and replace the specified text. | | | | Create a new element and append it to the specified parent element. | | Insert a new element before the specified element. | | Insert a new element after the specified element. | | Assign a value to a named member of the current script context object. | | Appends a value to a named member of the current script context object. | | Prepend a value to a named member of the current script context object. |
assignxajax.dom.assign = function( | element, | | property, | | data | ) |
|
Assign an element’s attribute to the specified value. element | (object): The HTML element to effect. | property | (string): The name of the attribute to set. | data | (string): The new value to be applied. |
Returnstrue | The operation completed successfully. |
appendxajax.dom.append = function( | element, | | property, | | data | ) |
|
Append the specified value to an element’s attribute. element | (object): The HTML element to effect. | property | (string): The name of the attribute to append to. | data | (string): The new value to be appended. |
Returnstrue | The operation completed successfully. |
prependxajax.dom.prepend = function( | element, | | property, | | data | ) |
|
Prepend the specified value to an element’s attribute. element | (object): The HTML element to effect. | property | (string): The name of the attribute. | data | (string): The new value to be prepended. |
Returnstrue | The operation completed successfully. |
replacexajax.dom.replace = function( | element, | | sAttribute, | | aData | ) |
|
Search and replace the specified text. element | (string or object): The name of, or the element itself which is to be modified. | sAttribute | (string): The name of the attribute to be set. | aData | (array): The search text and replacement text. |
Returnstrue | The operation completed successfully. |
removexajax.dom.remove = function( | element | ) |
|
Delete an element. element | (string or object): The name of, or the element itself which will be deleted. |
Returnstrue | The operation completed successfully. |
createxajax.dom.create = function( | objParent, | | sTag, | | sId | ) |
|
Create a new element and append it to the specified parent element. objParent | (string or object): The name of, or the element itself which will contain the new element. | sTag | (string): The tag name for the new element. | sId | (string): The value to be assigned to the id attribute of the new element. |
Returnstrue | The operation completed successfully. |
insertxajax.dom.insert = function( | objSibling, | | sTag, | | sId | ) |
|
Insert a new element before the specified element. objSibling | (string or object): The name of, or the element itself that will be used as the reference point for insertion. | sTag | (string): The tag name for the new element. | sId | (string): The value that will be assigned to the new element’s id attribute. |
Returnstrue | The operation completed successfully. |
insertAfterxajax.dom.insertAfter = function( | objSibling, | | sTag, | | sId | ) |
|
Insert a new element after the specified element. objSibling | (string or object): The name of, or the element itself that will be used as the reference point for insertion. | sTag | (string): The tag name for the new element. | sId | (string): The value that will be assigned to the new element’s id attribute. |
Returnstrue | The operation completed successfully. |
contextAssignxajax.dom.contextAssign = function( | args | ) |
|
Assign a value to a named member of the current script context object. args | (object): The response command object which will contain the following: |
- args.property: (string): The name of the member to assign.
- args.data: (string or object): The value to assign to the member.
- args.context: (object): The current script context object which is accessable via the ‘this’ keyword.
Returnstrue | The operation completed successfully. |
contextAppendxajax.dom.contextAppend = function( | args | ) |
|
Appends a value to a named member of the current script context object. args | (object): The response command object which will contain the following: |
- args.property: (string): The name of the member to append to.
- args.data: (string or object): The value to append to the member.
- args.context: (object): The current script context object which is accessable via the ‘this’ keyword.
Returnstrue | The operation completed successfully. |
contextPrependxajax.dom.contextPrepend = function( | args | ) |
|
Prepend a value to a named member of the current script context object. args | (object): The response command object which will contain the following: |
- args.property: (string): The name of the member to prepend to.
- args.data: (string or object): The value to prepend to the member.
- args.context: (object): The current script context object which is accessable via the ‘this’ keyword.
Returnstrue | The operation completed successfully. |
xajax.cssSummary | | | Add a LINK reference to the specified .css file if it does not already exist in the HEAD of the current document. | | Locate and remove a LINK reference from the current document’s HEAD. | | Attempt to detect when all .css files have been loaded once they are referenced by a LINK tag in the HEAD of the current document. |
addxajax.css.add = function( | filename | ) |
|
Add a LINK reference to the specified .css file if it does not already exist in the HEAD of the current document. filename | (string): The URI of the .css file to reference. |
Returnstrue | The operation completed successfully. |
removexajax.css.remove = function( | filename | ) |
|
Locate and remove a LINK reference from the current document’s HEAD. filename | (string): The URI of the .css file. |
Returnstrue | The operation completed successfully. |
waitForCSSxajax.css.waitForCSS = function( | args | ) |
|
Attempt to detect when all .css files have been loaded once they are referenced by a LINK tag in the HEAD of the current document. args | (object): The response command object which will contain the following: |
- args.property - (integer): The number of 1/10ths of a second to wait before giving up.
Returnstrue | The .css files appear to be loaded. | false | The .css files do not appear to be loaded and the timeout has not expired. |
xajax. formsSummary | | | Create and return a form input element with the specified parameters. | | Create a new input element under the specified parent. | | Insert a new input element before the specified element. | | Insert a new input element after the specified element. |
getInputCreate and return a form input element with the specified parameters. type | (string): The type of input element desired. | name | (string): The value to be assigned to the name attribute. | id | (string): The value to be assigned to the id attribute. |
Returnsobject | The new input element. |
createInputxajax.forms.createInput = function( | objParent, | | sType, | | sName, | | sId | ) |
|
Create a new input element under the specified parent. objParent | (string or object): The name of, or the element itself that will be used as the reference for the insertion. | sType | (string): The value to be assigned to the type attribute. | sName | (string): The value to be assigned to the name attribute. | sId | (string): The value to be assigned to the id attribute. |
Returnstrue | The operation completed successfully. |
insertInputxajax.forms.insertInput = function( | objSibling, | | sType, | | sName, | | sId | ) |
|
Insert a new input element before the specified element. objSibling | (string or object): The name of, or the element itself that will be used as the reference for the insertion. | sType | (string): The value to be assigned to the type attribute. | sName | (string): The value to be assigned to the name attribute. | sId | (string): The value to be assigned to the id attribute. |
Returnstrue | The operation completed successfully. |
insertInputAfterxajax.forms.insertInputAfter = function( | objSibling, | | sType, | | sName, | | sId | ) |
|
Insert a new input element after the specified element. objSibling | (string or object): The name of, or the element itself that will be used as the reference for the insertion. | sType | (string): The value to be assigned to the type attribute. | sName | (string): The value to be assigned to the name attribute. | sId | (string): The value to be assigned to the id attribute. |
Returnstrue | The operation completed successfully. |
xajax. eventsSummary | | | | | Add an event handler to the specified element. | | Remove an event handler from an element. |
setEventxajax.events.setEvent = function( | element, | | sEvent, | | code | ) |
|
Set an event handler. element | (string or object): The name of, or the object itself. | event | (string): The name of the event to set. | code | (string): The javascript code to be assigned to this event. |
Returnstrue | The operation completed successfully. |
addHandlerAdd an event handler to the specified element. element | (string or object): The name of, or the element itself which will have the event handler assigned. | sEvent | (string): The name of the event. | fun | (string): The function to be called. |
Returnstrue | The operation completed successfully. |
removeHandlerRemove an event handler from an element. element | (string or object): The name of, or the element itself which will have the event handler removed. | event | (string): The name of the event for which this handler is associated. | fun | The function to be removed. |
Returnstrue | The operation completed successfully. |
xajax. callbackSummary | | | Create a blank callback object. | | Create a timer to fire an event in the future. | | Clear a callback timer for the specified function. | | Execute a callback event. |
createxajax.callback.create = function() |
Create a blank callback object. Two optional arguments let you set the delay time for the onResponseDelay and onExpiration events. Returnsobject | The callback object. |
setupTimerxajax.callback.setupTimer = function( | iDelay | ) |
|
Create a timer to fire an event in the future. This will be used fire the onRequestDelay and onExpiration events. iDelay | (integer): The amount of time in milliseconds to delay. |
Returnsobject | A callback timer object. |
clearTimerxajax.callback.clearTimer = function( | oCallback, | | sFunction | ) |
|
Clear a callback timer for the specified function. oCallback | (object): The callback object (or objects) that contain the specified function timer to be cleared. | sFunction | (string): The name of the function associated with the timer to be cleared. |
executexajax.callback.execute = function( | oCallback, | | sFunction, | | args | ) |
|
Execute a callback event. oCallback | (object): The callback object (or objects) which contain the event handlers to be executed. | sFunction | (string): The name of the event to be triggered. | args | (object): The request object for this request. |
xajax. callback. globalThe global callback object which is active for every request.
xajaxSummary | | | The response queue that holds response commands, once received from the server, until they are processed. | | This array contains a list of codes which will be returned from the server upon successful completion of the server portion of the request. | | This array contains a list of status codes returned by the server to indicate that the request failed for some reason. | | An array of status codes returned from the server to indicate a request for redirect to another URL. | | The array of command handlers that are currently available. | | | | Initialize a request object, populating default settings, where call specific settings are not already provided. | | Processes request specific parameters and generates the temporary variables needed by xajax to initiate and process the request. | | Prepares the XMLHttpRequest object for this xajax request. | | | | Initiates a call to the server. | | Create a request object and submit the request using the specified request type; all request parameters should be finalized by this point. | | This function is used internally by xajax to initiate a request to the server. | | | | | | This function attempts to determine, based on the content type of the reponse, what processor should be used for handling the response data. | | Take the parameters passed in the command of the XML response and convert them to parameters of the args object. | | Parses the child nodes of the command of the response XML. | | Perform a lookup on the command specified by the response command object passed in the first parameter. | | Called by the response command queue processor when all commands have been processed. | | | | | < |
|