// PHP5 ONLY - Uncomment to test //$testResponse->testPlugin->testMethod(); $testResponseOutput = htmlspecialchars($testResponse->getOutput()); $objResponse = new xajaxResponse(); $objResponse->assign("submittedDiv", "innerHTML", $testResponseOutput); $objResponse->plugin('testPlugin', 'testMethod'); return $objResponse; } $reqShowOutput =& $xajax->register(XAJAX_FUNCTION, "showOutput"); $xajax->processRequest(); include_once $core . '/xajaxControl.inc.php'; $controls = dirname(dirname(__FILE__)) . '/xajax_controls'; include_once $controls . '/button.inc.php'; include_once $controls . '/literal.inc.php'; $buttonShowOutput = new clsButton(array('attributes' => array('id' => 'btnShowOutput', 'name' => 'btnShowOutput'), 'children' => array(new clsLiteral('Show Response XML')))); $buttonShowOutput->setEvent('onclick', $reqShowOutput); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Basic Plugin Test | xajax Tests</title> <?php $xajax->printJavascript(); ?> </head> <body> <h2><a href="index.php">xajax Tests</a></h2> <h1>Basic Plugin Test</h1>
$response->call("myOtherJSFunction"); return $response; } $requestCallScript =& $xajax->register(XAJAX_FUNCTION, "callScript"); $requestCallOtherScript =& $xajax->register(XAJAX_FUNCTION, "callOtherScript"); $xajax->processRequest(); $sRoot = dirname(dirname(dirname(__FILE__))); $sCore = '/xajax_core'; include_once $sRoot . $sCore . '/xajaxControl.inc.php'; $sControls = '/xajax_controls'; include_once $sRoot . $sControls . '/literal.inc.php'; include_once $sRoot . $sControls . '/button.inc.php'; $buttonCallScript = new clsButton(array('attributes' => array('id' => 'call_script'), 'children' => array(new clsLiteral('Click Me')))); $buttonCallScript->setEvent('onclick', $requestCallScript); $buttonCallOtherScript = new clsButton(array('attributes' => array('id' => 'call_other_script'), 'children' => array(new clsLiteral('or Click Me')))); $buttonCallOtherScript->setEvent('onclick', $requestCallOtherScript); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>call Script Test | xajax Tests</title> <?php $xajax->printJavascript(); ?> <script type="text/javascript"> function myJSFunction(firstArg, numberArg, myArrayArg) { var newString = firstArg + " and " + (+numberArg + 100) + "\n"; newString += myArrayArg["myKey"] + " | " + myArrayArg.key2; alert(newString);
$aFunctions = $xajax->register(XAJAX_CALLABLE_OBJECT, $functions); $xajax->processRequest(); $sRoot = dirname(dirname(dirname(__FILE__))); $sCore = '/xajax_core'; include_once $sRoot . $sCore . '/xajaxControl.inc.php'; $sControls = '/xajax_controls'; include_once $sRoot . $sControls . '/literal.inc.php'; include_once $sRoot . $sControls . '/button.inc.php'; $buttonLoadCSS1 = new clsButton(array('attributes' => array('class' => 'loadCSS1', 'id' => 'loadCSS1'), 'children' => array(new clsLiteral('Load CSS 1')))); $buttonLoadCSS1->setEvent('onclick', $aFunctions['loadcss1']); $buttonUnloadCSS1 = new clsButton(array('attributes' => array('class' => 'initiallyHidden unloadCSS1', 'id' => 'unloadCSS1'), 'children' => array(new clsLiteral('Unload CSS 1')))); $buttonUnloadCSS1->setEvent('onclick', $aFunctions['unloadcss1']); $buttonLoadCSS2 = new clsButton(array('attributes' => array('class' => 'loadCSS2', 'id' => 'loadCSS2'), 'children' => array(new clsLiteral('Load CSS 2')))); $buttonLoadCSS2->setEvent('onclick', $aFunctions['loadcss2']); $buttonUnloadCSS2 = new clsButton(array('attributes' => array('class' => 'initiallyHidden unloadCSS2', 'id' => 'unloadCSS2'), 'children' => array(new clsLiteral('Unload CSS 2')))); $buttonUnloadCSS2->setEvent('onclick', $aFunctions['unloadcss2']); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Load / Unload CSS files</title> <?php $xajax->printJavascript(); ?> <script type='text/javascript'> /* <![CDATA[ */ clearLog = function() { xajax.$('log').innerHTML = ''; } /* ]]> */ </script>