[eluser]LifeSteala[/eluser]
Sure - here is how I did it.
In
MY_Controller put your ajax functions in it - like so:
Code:
function getUserAjax()
{
// Code to get user info via Ajax
}
function getCountries()
{
// Code to get a list of countries
}
These two functions are your Ajax functions. In
MY_Controller you also need:
Code:
function loadAjax()
{
$this->xajax->registerFunction(array('getUserAjax',&$this,'getUserAjax'));
$this->xajax->registerFunction(array('getCountries',&$this,'getCountries'));
}
In your
controller you then do this:
Code:
$this->loadAjax();
$data['xajax_js'] = $this->xajax->getJavascript(base_url());
$this->xajax->processRequest();
Viola, you have a global ajax function.
Hope this helps.
Good Luck!