Class: xajaxResponse
Source Location: /vendors/xajax/xajaxResponse.inc.php
The xajaxResponse class is used to create responses to be sent back to your Web page. A response contains one or more command messages for updating your page.
|
|
|
Class Details
Class Variables
Class Methods
constructor xajaxResponse [line 106]
xajaxResponse xajaxResponse(
[string
$sEncoding = XAJAX_DEFAULT_CHAR_ENCODING], [boolean
$bOutputEntities = false])
|
|
The constructor's main job is to set the character encoding for the response. Note: to change the character encoding for all of the responses, set the XAJAX_DEFAULT_ENCODING constant before you instantiate xajax.
Parameters:
method addAlert [line 292]
void addAlert(
string
$sMsg)
|
|
Adds an alert command message to the XML response. Usage: $objResponse->addAlert("This is important information");
Parameters:
method addAppend [line 207]
void addAppend(
string
$sTarget, string
$sAttribute, string
$sData)
|
|
Adds an append command message to the XML response. Usage: $objResponse->addAppend("contentDiv", "innerHTML", "Some New Text");
Parameters:
method addAssign [line 186]
void addAssign(
string
$sTarget, string
$sAttribute, string
$sData)
|
|
Adds an assign command message to the XML response. Usage: $objResponse->addAssign("contentDiv", "innerHTML", "Some Text");
Parameters:
method addClear [line 274]
void addClear(
string
$sTarget, string
$sAttribute)
|
|
Adds a clear command message to the XML response. Usage: $objResponse->addClear("contentDiv", "innerHTML");
Parameters:
method addCommand [line 795]
void addCommand(
array
$aAttributes, mixed
$mData)
|
|
Adds a commmand to the array of all commands
Parameters:
method addConfirmCommands [line 165]
void addConfirmCommands(
integer
$iCmdNumber, string
$sMessage)
|
|
Adds a confirm commands command message to the XML response. Usage: $objResponse->addConfirmCommands(1, "Do you want to preview the new data?");
Parameters:
method addCreate [line 426]
void addCreate(
string
$sParent, string
$sTag, string
$sId, [string
$sType = ""])
|
|
Adds a create element command message to the XML response. Usage: $objResponse->addCreate("parentDiv", "h3", "myid");
Parameters:
method addCreateInput [line 497]
void addCreateInput(
string
$sParent, string
$sType, string
$sName, string
$sId)
|
|
Adds a create input command message to the XML response. Usage: $objResponse->addCreateInput("form1", "text", "username", "input1");
Parameters:
method addEvent [line 565]
void addEvent(
string
$sTarget, string
$sEvent, string
$sScript)
|
|
Adds an event command message to the XML response. Usage: $objResponse->addEvent("contentDiv", "onclick", "alert(\'Hello World\');");
Parameters:
method addHandler [line 581]
void addHandler(
string
$sTarget, string
$sEvent, string
$sHandler)
|
|
Adds a handler command message to the XML response. Usage: $objResponse->addHandler("contentDiv", "onclick", "content_click");
Parameters:
method addIncludeScript [line 616]
void addIncludeScript(
string
$sFileName)
|
|
Adds an include script command message to the XML response. Usage: $objResponse->addIncludeScript("functions.js");
Parameters:
method addInsert [line 452]
void addInsert(
string
$sBefore, string
$sTag, string
$sId)
|
|
Adds a insert element command message to the XML response. Usage: $objResponse->addInsert("childDiv", "h3", "myid");
Parameters:
method addInsertAfter [line 473]
void addInsertAfter(
string
$sAfter, string
$sTag, string
$sId)
|
|
Adds a insert element command message to the XML response. Usage: $objResponse->addInsertAfter("childDiv", "h3", "myid");
Parameters:
method addInsertInput [line 521]
void addInsertInput(
string
$sBefore, string
$sType, string
$sName, string
$sId)
|
|
Adds an insert input command message to the XML response. Usage: $objResponse->addInsertInput("input5", "text", "username", "input1");
Parameters:
method addInsertInputAfter [line 545]
void addInsertInputAfter(
string
$sAfter, string
$sType, string
$sName, string
$sId)
|
|
Adds an insert input command message to the XML response. Usage: $objResponse->addInsertInputAfter("input7", "text", "email", "input2");
Parameters:
method addPrepend [line 229]
void addPrepend(
string
$sTarget, string
$sAttribute, string
$sData)
|
|
Adds an prepend command message to the XML response. Usage: $objResponse->addPrepend("contentDiv", "innerHTML", "Some Starting Text");
Parameters:
method addRedirect [line 310]
void addRedirect(
string
$sURL, [
$iDelay = 0])
|
|
Uses the addScript() method to add a Javascript redirect to another URL. Usage: $objResponse->redirect("http://www.xajaxproject.org");
Parameters:
method addRemove [line 404]
void addRemove(
string
$sTarget)
|
|
Adds a remove element command message to the XML response. Usage: $objResponse->addRemove("Div2");
Parameters:
method addRemoveHandler [line 598]
void addRemoveHandler(
string
$sTarget, string
$sEvent, string
$sHandler)
|
|
Adds a remove handler command message to the XML response. Usage: $objResponse->addRemoveHandler("contentDiv", "onclick", "content_click");
Parameters:
method addReplace [line 252]
void addReplace(
string
$sTarget, string
$sAttribute, string
$sSearch, string
$sData)
|
|
Adds a replace command message to the XML response. Usage: $objResponse->addReplace("contentDiv", "innerHTML", "text", "<b>text</b>");
Parameters:
method addScript [line 363]
void addScript(
string
$sJS)
|
|
Adds a Javascript command message to the XML response. Usage: $objResponse->addScript("var x = prompt('get some text');");
Parameters:
method addScriptCall [line 382]
void addScriptCall(
string
$sFunc, mixed
$args,...)
|
|
Adds a Javascript function call command message to the XML response. Usage: $objResponse->addScriptCall("myJSFunction", "arg 1", "arg 2", 12345);
Parameters:
method alert [line 298]
method append [line 213]
void append(
$sTarget,
$sAttribute,
$sData)
|
|
Parameters:
method assign [line 192]
void assign(
$sTarget,
$sAttribute,
$sData)
|
|
Parameters:
method call [line 391]
method clear [line 280]
void clear(
$sTarget,
$sAttribute)
|
|
Parameters:
method confirmCommands [line 171]
void confirmCommands(
$iCmdNumber,
$sMessage)
|
|
Parameters:
method create [line 437]
void create(
$sParent,
$sTag,
$sId, [
$sType = ""])
|
|
Parameters:
method createInput [line 503]
void createInput(
$sParent,
$sType,
$sName,
$sId)
|
|
Parameters:
method getOutput [line 637]
Returns the XML to be returned from your function to the xajax processor on your page. Since xajax 0.2, you can also return an xajaxResponse object from your function directly, and xajax will automatically request the XML using this method call. Usage: return $objResponse->getXML();
Tags:
method getXML [line 662]
method includeScript [line 622]
void includeScript(
$sFilename)
|
|
Parameters:
method insert [line 458]
void insert(
$sBefore,
$sTag,
$sId)
|
|
Parameters:
method insertAfter [line 479]
void insertAfter(
$sAfter,
$sTag,
$sId)
|
|
Parameters:
method insertInput [line 527]
void insertInput(
$sBefore,
$sType,
$sName,
$sId)
|
|
Parameters:
method insertInputAfter [line 551]
void insertInputAfter(
$sAfter,
$sType,
$sName,
$sId)
|
|
Parameters:
method loadCommands [line 696]
void loadCommands(
$mCommands)
|
|
Parameters:
method loadXML [line 679]
void loadXML(
string
$mCommands)
|
|
Adds the commands of the provided response XML output to this response object Usage: $r1 = $objResponse1->getXML();
return $objResponse2->getXML();
Parameters:
method outputEntitiesOff [line 151]
void outputEntitiesOff(
)
|
|
Tells the response object to output special characters intact. (default behavior)
method outputEntitiesOn [line 142]
Tells the response object to convert special characters to HTML entities automatically (only works if the mb_string extension is available).
method prepend [line 235]
void prepend(
$sTarget,
$sAttribute,
$sData)
|
|
Parameters:
method redirect [line 351]
void redirect(
$sURL, [
$iDelay = 0])
|
|
Parameters:
method remove [line 410]
method removeHandler [line 604]
void removeHandler(
$sTarget,
$sEvent,
$sHandler)
|
|
Parameters:
method replace [line 260]
void replace(
$sTarget,
$sAttribute,
$sSearch,
$sData)
|
|
Parameters:
method script [line 369]
method setCharEncoding [line 122]
void setCharEncoding(
string
$sEncoding)
|
|
Sets the character encoding for the response based on $sEncoding, which is a string containing the character encoding to use. You don't need to use this method normally, since the character encoding for the response gets set automatically based on the XAJAX_DEFAULT_CHAR_ENCODING constant.
Parameters:
method setOutputEntities [line 132]
void setOutputEntities(
$bOption)
|
|
If true, tells the response object to convert special characters to HTML entities automatically (only works if the mb_string extension is available).
Parameters:
|
|