ajax(); } public function index() { $this->main(); } // ------------------------------------------------------------------------ ///////////////////////////////////////////////////////////////////////////// function ajax() { $this->load->library('xajax/xajax'); # libraries/xajax/Xajax.php $this->xajax->configure("requestURI", base_url().'index.php/site/'); # index.php/controller/ $this->xajax->configure("javascript URI", base_url().'public/js/'); # loc of xajax_js/ $this->xajax->register(XAJAX_FUNCTION, array('say_hello', $this, 'say_hello')); $this->xajax->processRequest(); } function say_hello(){ $objResponse = new xajaxResponse(); $objResponse->Assign("ajax_div", "innerHTML", "Just saying hello from XAJAX."); return $objResponse; } } ?>