xajaxCall. inc.php

Contains the xajaxCall class

Summary
Contains the xajaxCall class
Please see copyright.inc.php for a detailed description, copyright and license information.
Create a piece of javascript code that will invoke the xajax.call function.
Required: The name of the xajax enabled function to call
Required: The value to return once the xajax.call has returned.
The associative array that will be used to store the parameters for this call.
The mode to use for the call
The request type that will be used for the call
The name of the javascript function that will be invoked to handle the response.
The URI for where this request will be sent.
The content type to use for the request.
Initializes the xajaxCall object.
Override the function name set in the constructor.
Clear the list of parameters being accumulated for this call.
Adds a parameter to the list that will be specified for the request generated by this xajaxCall object.
Add a parameter value that is the result of calling xajax.getFormValues for the specified form.
Sets the mode that will be specified for this xajax.call
Sets the request type which will be specified for the generated xajax.call.
Sets the name of the javascript function that will be used to process this response.
Override the default URI with the specified one.
Sets the content type that will be used by the generated request.
Sets the value that will be returned after the generated call.
Construct a xajax.call statement in javascript that can be used to make a xajax request with the parameters and settings previously configured for this xajaxCall object.

xajaxCall class

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

xajaxCall

Create a piece of javascript code that will invoke the xajax.call function.

This class is deprecated and will be removed in future versions; please use xajaxRequest instead.

Summary
Required: The name of the xajax enabled function to call
Required: The value to return once the xajax.call has returned.
The associative array that will be used to store the parameters for this call.
The mode to use for the call
The request type that will be used for the call
The name of the javascript function that will be invoked to handle the response.
The URI for where this request will be sent.
The content type to use for the request.
Initializes the xajaxCall object.
Override the function name set in the constructor.
Clear the list of parameters being accumulated for this call.
Adds a parameter to the list that will be specified for the request generated by this xajaxCall object.
Add a parameter value that is the result of calling xajax.getFormValues for the specified form.
Sets the mode that will be specified for this xajax.call
Sets the request type which will be specified for the generated xajax.call.
Sets the name of the javascript function that will be used to process this response.
Override the default URI with the specified one.
Sets the content type that will be used by the generated request.
Sets the value that will be returned after the generated call.
Construct a xajax.call statement in javascript that can be used to make a xajax request with the parameters and settings previously configured for this xajaxCall object.

Variables

sFunction

var $sFunction

Required: The name of the xajax enabled function to call

sReturnValue

var $sReturnValue

Required: The value to return once the xajax.call has returned.  (for asynchronous calls, this is immediate)

aParameters

var $aParameters

The associative array that will be used to store the parameters for this call.

  • key: The textual representation of the parameter.
  • value: A boolean value indicating whether or not to use quotes around this parameter.

sMode

var $sMode

The mode to use for the call

  • ’synchronous’
  • ’asynchronous’

sRequestType

var $sRequestType

The request type that will be used for the call

  • ’GET’
  • ’POST’

sResponseProcessor

var $sResponseProcessor

The name of the javascript function that will be invoked to handle the response.

sRequestURI

var $sRequestURI

The URI for where this request will be sent.

sContentType

var $sContentType

The content type to use for the request.

Functions

xajaxCall

function xajaxCall($sFunction =  '')

Initializes the xajaxCall object.

sFunction(string): The name of the xajax enabled function that will be invoked when this javascript code is executed on the browser.  This function name should match a PHP function from your script.

setFunction

function setFunction($sFunction)

Override the function name set in the constructor.

Returns

objectThe xajaxCall object.

clearParameters

function clearParameters()

Clear the list of parameters being accumulated for this call.

Returns

objectThe xajaxCall object.

addParameter

function addParameter($sParameter,  
$bUseQuotes =  true)

Adds a parameter to the list that will be specified for the request generated by this xajaxCall object.

sParameter(string): The parameter value or name.
bUseQuotes(boolean): Whether or not to put quotes around this value.

If you specify the name of a javascript variable, or provide a javascript function call as a parameter, do not use quotes around the value.

Returns

objectThe xajaxCall object.

addFormValuesParameter

function addFormValuesParameter($sFormID)

Add a parameter value that is the result of calling xajax.getFormValues for the specified form.

sFormID(string): The id of the form for which you wish to return the input values.

Returns

objectThe xajaxCall object.

setMode

function setMode($sMode)

Sets the mode that will be specified for this xajax.call

  • ’synchronous’
  • ’asynchronous’

Returns

objectThe xajaxCall object.

setRequestType

function setRequestType($sRequestType)

Sets the request type which will be specified for the generated xajax.call.

  • ’GET’
  • ’POST’

Returns

objectThe xajaxCall object.

setResponseProcessor

function setResponseProcessor($sResponseProcessor)

Sets the name of the javascript function that will be used to process this response.  This is an advanced function, use with caution.

Returns

objectThe xajaxCall object.

setRequestURI

function setRequestURI($sRequestURI)

Override the default URI with the specified one.

sRequestURI(string): The URI that the generated request will be sent to.

Returns

objectThe xajaxCall object.

setContentType

function setContentType($sContentType)

Sets the content type that will be used by the generated request.

Returns

objectThe xajaxCall object.

setReturnValue

function setReturnValue($sReturnValue)

Sets the value that will be returned after the generated call.  Set to an empty string if no return value is desired.

Returns

objectThe xajaxCall object.

generate

function generate()

Construct a xajax.call statement in javascript that can be used to make a xajax request with the parameters and settings previously configured for this xajaxCall object.

The output from this function can be used as an event handler in your javascript code.

Returns

stringThe javascript statement that will invoked the xajax.call function on the browser, causing a xajax request to be sent to the server.
This file contains detailed information regarding the xajax project, current version, copyrights, licnese and documentation.
xajax.call = function()
Initiates a call to the server.
var $sFunction
Required: The name of the xajax enabled function to call
var $sReturnValue
Required: The value to return once the xajax.call has returned.
var $aParameters
The associative array that will be used to store the parameters for this call.
var $sMode
The mode to use for the call
var $sRequestType
The request type that will be used for the call
var $sResponseProcessor
The name of the javascript function that will be invoked to handle the response.
var $sRequestURI
The URI for where this request will be sent.
var $sContentType
The content type to use for the request.
function xajaxCall($sFunction =  '')
Initializes the xajaxCall object.
function setFunction($sFunction)
Override the function name set in the constructor.
function clearParameters()
Clear the list of parameters being accumulated for this call.
function addParameter($sParameter,  
$bUseQuotes =  true)
Adds a parameter to the list that will be specified for the request generated by this xajaxCall object.
function addFormValuesParameter($sFormID)
Add a parameter value that is the result of calling xajax.getFormValues for the specified form.
Shortcut to xajax.tools.getFormValues.
function setMode($sMode)
Sets the mode that will be specified for this xajax.call
function setRequestType($sRequestType)
Sets the request type which will be specified for the generated xajax.call.
function setResponseProcessor($sResponseProcessor)
Sets the name of the javascript function that will be used to process this response.
function setRequestURI($sRequestURI)
Override the default URI with the specified one.
function setContentType($sContentType)
Sets the content type that will be used by the generated request.
function setReturnValue($sReturnValue)
Sets the value that will be returned after the generated call.
function generate()
Construct a xajax.call statement in javascript that can be used to make a xajax request with the parameters and settings previously configured for this xajaxCall object.
Used to store and generate the client script necessary to invoke a xajax request from the browser to the server script.