You got most of it right, except the “ajax controllers workflow”
Ajax controller are separate than regular controllers. It is not recommended to request the same index controller (unless you really know what you are doing) because you would be invoking all the media (css/js) stuff to load again and that can interfere with the application from working and also will make it slower.
try it more like this:
<?php
//MAKE sure cjax is includes:
require_once 'ajafw.php'; // in 5.1 require_once 'ajax.php';
$this->ajax = ajax();
$this->ajax->Exec('user_guide',$this->ajax->call('ajax.php?welcome2/index_ajax','container');
?>
<!DOCTYPE html>
<html lang=“en”>
<head>
<?php echo $this->ajax->init();?>
<style type=“text/css”>
a {
color: #003399;
background-color: transparent;
font-weight: normal;
}
</style>
</head>
<body>
<div id='container'>
See <a id='user_guide'>User Guide</a> text.
</div>
</body>
</html>
The in application/response/welcome2.php
class Welcome2 extends CI_Controller {
function index_ajax {
echo "If you are exploring CodeIgniter for the very first time, you should start by reading the User Guide";
}
}
See creating controllers: http://cjax.sourceforge.net/docs/creating_controllers.php