[eluser]worchyld[/eluser]
I'm almost there, but when I click on the link (now ajaxed) it produces;
"ob_start() [<a href='ref.outcontrol'>ref.outcontrol</a>]: Cannot use output buffering in output buffering display handlers in C:\Program Files\xampp\htdocs\codeignitor\system\libraries\Exceptions.php on line 160"
I've removed all custom view libraries (as found per wiki), but it still displays the error. I'm going to look at a simple JQuery output in CI to see if this can help.
EDIT:
I've found out that the reason why this message comes up is because your outputting right inside your controller.
So, I went back to a very simple JQuery HTML loading example in CI. Note that
this works!
So hopefully I can apply the idea to my above question;
The HEAD;
Code:
<base href="<?=base_url()?>" />
<scr+ipt type="text/javascript" src="assets/javascript/jquery.js"></scr+ipt>
<scri+pt type="text/javascript">
/* <![CDATA[ */
$(document).ready(function() {
$("a#generate").click(function() {
var href = $(this).attr('href');
// alert(href);
$('p.surprise').hide().load(href, function() {
$(this).addClass("ohmy").show("slow");
});
return false;
});
});
/* ]]> */
</scr+ipt>
<style type="text/css">
p.surprise {
display: none;
margin-bottom: 5px;
}
p.ohmy{
padding:5px;
border:1px solid #acd373;
background:#fafff3;
margin-bottom: 10px;
}
</style>
// The BODY
Code:
<a id="generate" href="index.php/message_slideshow/get_message/">Run</a>
<p class="surprise">
</p>
// The CONTROLLER
Code:
class Message_slideshow extends Controller {
function Message_slideshow() {
parent::Controller();
$this->load->library('view');
// $this->output->enable_profiler(TRUE);
}
function index() {
$this->view->load("message_slideshow");
}
function get_message() {
$this->view->load("jquery_message");
}
} // end class
// JQuery Message (VIEW)
Code:
Congratulations! You just ran a snippet of jQuery code. Wasn't that easy?