[eluser]Jordz[/eluser]
Morning (Well it is here anyway :p),
For the past hour I've been experimenting with AJAX, it's not fully implemented into my CI app just yet I just load a view from my controller. My question is how would I send the ajax function to a database model in my CI app?
Code:
[removed][removed]
[removed]
$(document).ready(function(){
$('#txtValue').keyup(function(){
sendValue($(this).val());
});
});
function sendValue(str){
$.post("http://localhost:8888/ajax.php",{ sendValue: str }, //<- Here... I've tried tried putting my PHP AJAX
//controller in here as /test/ajax and even like $this->test_model->ajax()
function(data){
$('#display').html(data.returnValue);
}, "json");
}
How would I go about putting the php that controls the ajax into my CI framework without creating other files that are going to clog things up.
Thanks
Jordan.