xajax_debug.js

This optional file contains the debugging module for use with xajax.  If you include this module after the standard xajax_core.js module, you will receive debugging messages, including errors, that occur during the processing of your xajax requests.

Summary
This optional file contains the debugging module for use with xajax.
Please see copyright.inc.php for a detailed description, copyright and license information.
This object contains the variables and functions used to display process state messages and to trap error conditions and report them to the user via a secondary browser window or alert messages as necessary.
Stores a ‘unique’ identifier for this session so that an existing debugging window can be detected, else one will be created.
The default URL that is given to the debugging window upon creation.
A ‘unique’ name used to identify the debugging window that is attached to this xajax session.
The parameters that will be used to create the debugging window.
The HTML template and CSS style information used to populate the debugging window upon creation.
A reference to the debugging window, once constructed, where messages will be displayed throughout the request process.
Output a debug message to the debug window if available or send to an alert box.
Convert special characters to their HTML equivellents so they will show up in the xajax.debug.window.
Catch any exceptions that are thrown by a response command handler and display a message in the debugger.
Catch any exception thrown during the parsing of response command attributes and display an appropriate debug message.
Catch any exceptions thrown while attempting to locate an HTML element by it’s unique name.
Generate a message indicating that a javascript object is being converted to xml.
Generate a message indicating that the xajax request is about the be sent to the server.
Generate a message indicating that a request is ready to be submitted; providing the URL and the function being invoked.
Generate a message indicating that the request object is being initialized.
Generate a message indicating that the request object is being populated with the parameters provided.
Generate a message indicating that the request is being prepared.
Validates that a function name was provided, generates a message indicating that a xajax call is starting and sets a flag in the request object indicating that debugging is enabled for this call.
Validates that a function name was provided, generates a message indicating that a xajax request is starting and sets a flag in the request object indicating that debugging is enabled for this request.
Generate an error message when no reponse processor is available to process the type of response returned from the server.
Generate a message indicating that a response has been received from the server; provide some statistical data regarding the response and the response time.
Generate a message indicating that the request has completed and provide some statistics regarding the request and response.
Generate a message indicating that the request object is being initialized.
Catch any exceptions thrown during the assignment and display an error message.

xajax debugging module

Please see copyright.inc.php for a detailed description, copyright and license information.

xajax. debug

This object contains the variables and functions used to display process state messages and to trap error conditions and report them to the user via a secondary browser window or alert messages as necessary.

Summary
Stores a ‘unique’ identifier for this session so that an existing debugging window can be detected, else one will be created.
The default URL that is given to the debugging window upon creation.
A ‘unique’ name used to identify the debugging window that is attached to this xajax session.
The parameters that will be used to create the debugging window.
The HTML template and CSS style information used to populate the debugging window upon creation.
A reference to the debugging window, once constructed, where messages will be displayed throughout the request process.
Output a debug message to the debug window if available or send to an alert box.
Convert special characters to their HTML equivellents so they will show up in the xajax.debug.window.
Catch any exceptions that are thrown by a response command handler and display a message in the debugger.
Catch any exception thrown during the parsing of response command attributes and display an appropriate debug message.
Catch any exceptions thrown while attempting to locate an HTML element by it’s unique name.
Generate a message indicating that a javascript object is being converted to xml.
Generate a message indicating that the xajax request is about the be sent to the server.
Generate a message indicating that a request is ready to be submitted; providing the URL and the function being invoked.
Generate a message indicating that the request object is being initialized.
Generate a message indicating that the request object is being populated with the parameters provided.
Generate a message indicating that the request is being prepared.
Validates that a function name was provided, generates a message indicating that a xajax call is starting and sets a flag in the request object indicating that debugging is enabled for this call.
Validates that a function name was provided, generates a message indicating that a xajax request is starting and sets a flag in the request object indicating that debugging is enabled for this request.
Generate an error message when no reponse processor is available to process the type of response returned from the server.
Generate a message indicating that a response has been received from the server; provide some statistical data regarding the response and the response time.
Generate a message indicating that the request has completed and provide some statistics regarding the request and response.
Generate a message indicating that the request object is being initialized.
Catch any exceptions thrown during the assignment and display an error message.

Variables

workId

xajax.debug.workId

Stores a ‘unique’ identifier for this session so that an existing debugging window can be detected, else one will be created.

windowSource

xajax.debug.windowSource

The default URL that is given to the debugging window upon creation.

windowID

xajax.debug.windowID

A ‘unique’ name used to identify the debugging window that is attached to this xajax session.

windowStyle

if ('undefined' = = typeof xajax.debug.windowStyle) xajax.debug.windowStyle

The parameters that will be used to create the debugging window.

windowTemplate

if ('undefined' = = typeof xajax.debug.windowTemplate) xajax.debug.windowTemplate

The HTML template and CSS style information used to populate the debugging window upon creation.

window

A reference to the debugging window, once constructed, where messages will be displayed throughout the request process.  This is constructed internally as needed.

text

xajax.debug.text

exceptions

xajax.debug.exceptions

Functions

getExceptionText

xajax.debug.getExceptionText = function(e)

writeMessage

xajax.debug.writeMessage = function(text,
prefix,
cls)

Output a debug message to the debug window if available or send to an alert box.  If the debug window has not been created, attempt to create it.

text(string): The text to output.
prefix(string): The prefix to use; this is prepended onto the message; it should indicate the type of message (warning, error)
cls(stirng): The className that will be applied to the message; invoking a style from the CSS provided in xajax.debug.windowTemplate.  Should be one of the following:
  • warningText
  • errorText

prepareDebugText

xajax.debug.prepareDebugText = function(text)

Convert special characters to their HTML equivellents so they will show up in the xajax.debug.window.

executeCommand

xajax.debug.executeCommand = xajax.executeCommand; xajax.executeCommand = function(
   args
)

Catch any exceptions that are thrown by a response command handler and display a message in the debugger.

This is a wrapper function which surrounds the standard xajax.executeCommand function.

parseAttributes

xajax.debug.parseAttributes = xajax.parseAttributes; xajax.parseAttributes = function(
   child,
   obj
)

Catch any exception thrown during the parsing of response command attributes and display an appropriate debug message.

This is a wrapper around the standard xajax.parseAttributes function.

$

xajax.debug.$ = xajax.tools.$; xajax.tools.$ = function(sId)

Catch any exceptions thrown while attempting to locate an HTML element by it’s unique name.

This is a wrapper around the standard xajax.tools.$ function.

_objectToXML

xajax.debug._objectToXML = xajax.tools._objectToXML; xajax.tools._objectToXML = function(
   obj,
   guard
)

Generate a message indicating that a javascript object is being converted to xml.  Indicate the max depth and size.  Then display the size of the object upon completion.  Catch any exceptions thrown during the conversion process.

This is a wrapper around the standard xajax.tools._objectToXML function.

_internalSend

xajax.debug._internalSend = xajax._internalSend; xajax._internalSend = function(
   oRequest
)

Generate a message indicating that the xajax request is about the be sent to the server.

This is a wrapper around the standard xajax._internalSend function.

submitRequest

xajax.debug.submitRequest = xajax.submitRequest; xajax.submitRequest = function(
   oRequest
)

Generate a message indicating that a request is ready to be submitted; providing the URL and the function being invoked.

Catch any exceptions thrown and display a message.

This is a wrapper around the standard xajax.submitRequest function.

initializeRequest

xajax.debug.initializeRequest = xajax.initializeRequest; xajax.initializeRequest = function(
   oRequest
)

Generate a message indicating that the request object is being initialized.

This is a wrapper around the standard xajax.initializeRequest function.

processParameters

xajax.debug.processParameters = xajax.processParameters; xajax.processParameters = function(
   oRequest
)

Generate a message indicating that the request object is being populated with the parameters provided.

This is a wrapper around the standard xajax.processParameters function.

prepareRequest

xajax.debug.prepareRequest = xajax.prepareRequest; xajax.prepareRequest = function(
   oRequest
)

Generate a message indicating that the request is being prepared.  This may occur more than once for a request if it errors and a retry is attempted.

This is a wrapper around the standard xajax.prepareRequest

call

xajax.debug.call = xajax.call; xajax.call = function()

Validates that a function name was provided, generates a message indicating that a xajax call is starting and sets a flag in the request object indicating that debugging is enabled for this call.

This is a wrapper around the standard xajax.call function.

request

xajax.debug.request = xajax.request; xajax.request = function()

Validates that a function name was provided, generates a message indicating that a xajax request is starting and sets a flag in the request object indicating that debugging is enabled for this request.

This is a wrapper around the standard xajax.request function.

getResponseProcessor

xajax.debug.getResponseProcessor = xajax.getResponseProcessor; xajax.getResponseProcessor = function(
   oRequest
)

Generate an error message when no reponse processor is available to process the type of response returned from the server.

This is a wrapper around the standard xajax.getResponseProcessor function.

responseReceived

xajax.debug.responseReceived = xajax.responseReceived; xajax.responseReceived = function(
   oRequest
)

Generate a message indicating that a response has been received from the server; provide some statistical data regarding the response and the response time.

Catch any exceptions that are thrown during the processing of the response and generate a message.

This is a wrapper around the standard xajax.responseReceived function.

completeRequest

Generate a message indicating that the request has completed and provide some statistics regarding the request and response.

This is a wrapper around the standard xajax.completeResponse function.

getRequestObject

xajax.debug.getRequestObject = xajax.tools.getRequestObject; xajax.tools.getRequestObject = function()

Generate a message indicating that the request object is being initialized.

Catch any exceptions that are thrown during the process or initializing a new request object.

This is a wrapper around the standard <xajax.getRequestObject> function.

assign

if (xajax.dom.assign)

Catch any exceptions thrown during the assignment and display an error message.

This is a wrapper around the standard xajax.dom.assign function.

xajax. tools. queue. retry

Variables

isLoaded

xajax.debug.isLoaded
trueindicates that the debugging module is loaded

Redefine shortcuts.

Must redefine these shortcuts so they point to the new debug (wrapper) versions

Must redefine these shortcuts as well

This file contains detailed information regarding the xajax project, current version, copyrights, licnese and documentation.
xajax.debug.workId
Stores a ‘unique’ identifier for this session so that an existing debugging window can be detected, else one will be created.
xajax.debug.windowSource
The default URL that is given to the debugging window upon creation.
xajax.debug.windowID
A ‘unique’ name used to identify the debugging window that is attached to this xajax session.
if ('undefined' = = typeof xajax.debug.windowStyle) xajax.debug.windowStyle
The parameters that will be used to create the debugging window.
if ('undefined' = = typeof xajax.debug.windowTemplate) xajax.debug.windowTemplate
The HTML template and CSS style information used to populate the debugging window upon creation.
xajax.debug.text
xajax.debug.exceptions
xajax.debug.getExceptionText = function(e)
xajax.debug.writeMessage = function(text,
prefix,
cls)
Output a debug message to the debug window if available or send to an alert box.
xajax.debug.prepareDebugText = function(text)
Convert special characters to their HTML equivellents so they will show up in the xajax.debug.window.
A reference to the debugging window, once constructed, where messages will be displayed throughout the request process.
xajax.debug.executeCommand = xajax.executeCommand; xajax.executeCommand = function(
   args
)
Catch any exceptions that are thrown by a response command handler and display a message in the debugger.
xajax.debug.parseAttributes = xajax.parseAttributes; xajax.parseAttributes = function(
   child,
   obj
)
Catch any exception thrown during the parsing of response command attributes and display an appropriate debug message.
xajax.debug.$ = xajax.tools.$; xajax.tools.$ = function(sId)
Catch any exceptions thrown while attempting to locate an HTML element by it’s unique name.
xajax.debug._objectToXML = xajax.tools._objectToXML; xajax.tools._objectToXML = function(
   obj,
   guard
)
Generate a message indicating that a javascript object is being converted to xml.
xajax.debug._internalSend = xajax._internalSend; xajax._internalSend = function(
   oRequest
)
Generate a message indicating that the xajax request is about the be sent to the server.
xajax.debug.submitRequest = xajax.submitRequest; xajax.submitRequest = function(
   oRequest
)
Generate a message indicating that a request is ready to be submitted; providing the URL and the function being invoked.
xajax.debug.initializeRequest = xajax.initializeRequest; xajax.initializeRequest = function(
   oRequest
)
Generate a message indicating that the request object is being initialized.
xajax.debug.processParameters = xajax.processParameters; xajax.processParameters = function(
   oRequest
)
Generate a message indicating that the request object is being populated with the parameters provided.
xajax.debug.prepareRequest = xajax.prepareRequest; xajax.prepareRequest = function(
   oRequest
)
Generate a message indicating that the request is being prepared.
xajax.debug.call = xajax.call; xajax.call = function()
Validates that a function name was provided, generates a message indicating that a xajax call is starting and sets a flag in the request object indicating that debugging is enabled for this call.
xajax.debug.request = xajax.request; xajax.request = function()
Validates that a function name was provided, generates a message indicating that a xajax request is starting and sets a flag in the request object indicating that debugging is enabled for this request.
xajax.debug.getResponseProcessor = xajax.getResponseProcessor; xajax.getResponseProcessor = function(
   oRequest
)
Generate an error message when no reponse processor is available to process the type of response returned from the server.
xajax.debug.responseReceived = xajax.responseReceived; xajax.responseReceived = function(
   oRequest
)
Generate a message indicating that a response has been received from the server; provide some statistical data regarding the response and the response time.
xajax.debug.getRequestObject = xajax.tools.getRequestObject; xajax.tools.getRequestObject = function()
Generate a message indicating that the request object is being initialized.
if (xajax.dom.assign)
Catch any exceptions thrown during the assignment and display an error message.
xajax.debug.isLoaded
This file contains the definition of the main xajax javascript core.
xajax.executeCommand = function(obj)
Perform a lookup on the command specified by the response command object passed in the first parameter.
xajax.parseAttributes = function(child,
obj)
Take the parameters passed in the command of the XML response and convert them to parameters of the args object.
xajax.tools.$ = function(sId)
Shorthand for finding a uniquely named element within the document.
xajax.tools._objectToXML = function(obj,
guard)
Convert a javascript object or array into XML suitable for transmission to the server.
xajax._internalSend = function(oRequest)
This function is used internally by xajax to initiate a request to the server.
xajax.submitRequest = function(oRequest)
Create a request object and submit the request using the specified request type; all request parameters should be finalized by this point.
xajax.initializeRequest = function(oRequest)
Initialize a request object, populating default settings, where call specific settings are not already provided.
xajax.processParameters = function(oRequest)
Processes request specific parameters and generates the temporary variables needed by xajax to initiate and process the request.
xajax.prepareRequest = function(oRequest)
Prepares the XMLHttpRequest object for this xajax request.
xajax.call = function()
Initiates a call to the server.
xajax.request = function()
xajax.getResponseProcessor = function(oRequest)
This function attempts to determine, based on the content type of the reponse, what processor should be used for handling the response data.
xajax.responseReceived = function(oRequest)
Process the response.
xajax.completeResponse = function(oRequest)
Called by the response command queue processor when all commands have been processed.
xajax.dom.assign = function(element,
property,
data)
Assign an element’s attribute to the specified value.
Shortcut to xajax.tools.$.
Shortcut to xajax.tools.getFormValues.
Shortcut to xajax.call.
Shortcut to xajax.tools.$.
Shortcut to xajax.tools.getFormValues.