[eluser]phpuser[/eluser]
Hello,
I've added XAJAX library following the instructions from the XAJAX perfect setup article. All seems fine except when I try to run the test_function. Here is the code of the controller :
Code:
function test_function($number) {
$objResponse = new xajaxResponse();
$objResponse->assign("omeElementId","innerHTML", "Xajax is working. Lets add: ".($number+3));
return $objResponse->_printResponse_XML();
}
function showTemplate() {
$this->load->library('xajax');
$this->xajax->registerFunction("test_function");
$this->xajax->processRequest();
$template['xajax_js'] = $this->xajax->getjavascript(base_url());
$template['content'] = '<div id="SomeElementId"></div><input type="button" value="test">';
$this->load->view('template', $template);
}
Using firebug it returns the error "test_function is not defined".
If I try to call the test_function directly throught the browser it works fine, for example "http://127.0.0.1/myweb/index.php/mycontroller/test_function/3" it returns :
"SXajax is working. Lets add: 6"
Please, if anyone can help me with this.
Thanks !
Joseph