Welcome Guest, Not a member yet? Register   Sign In
XAJAX Test_Function is not defined
#3

[eluser]phpuser[/eluser]
Hello,

I think there's nothing special, just the class definition and the index method.

Code:
class mycontroller extends Controller {

function mycontroller(){
  parent::Controller();
  session_start();

  $this->load->model('mymodel','',TRUE);
}

function index(){    
  $this->load->view('home');
}

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>&lt;input type="button" value="test"&gt;';
  $this->load->view('template', $template);
}  
}

Thanks !


Messages In This Thread
XAJAX Test_Function is not defined - by El Forum - 11-15-2010, 07:37 PM
XAJAX Test_Function is not defined - by El Forum - 11-15-2010, 10:54 PM
XAJAX Test_Function is not defined - by El Forum - 11-16-2010, 04:23 AM
XAJAX Test_Function is not defined - by El Forum - 11-16-2010, 06:33 AM
XAJAX Test_Function is not defined - by El Forum - 11-16-2010, 06:16 PM



Theme © iAndrew 2016 - Forum software by © MyBB