addAssign("div1","innerHTML",$text); return $objResponse; } function setColor($sColor) { $objResponse = new xajaxResponse(); $objResponse->addAssign("div1","style.color", $sColor); return $objResponse; } // Instantiate the xajax object. No parameters defaults requestURI to this page, method to POST, and debug to off $xajax = new xajax(); //$xajax->debugOn(); // Uncomment this line to turn debugging on // Specify the PHP functions to wrap. The JavaScript wrappers will be named xajax_functionname $xajax->registerFunction("helloWorld"); $xajax->registerFunction("setColor"); // Process any requests. Because our requestURI is the same as our html page, // this must be called before any headers or HTML output have been sent $xajax->processRequests(); ?> xajax example printJavascript('../'); // output the xajax javascript. This must be called between the head tags ?>