[eluser]jon29[/eluser]
hi I'm having real problems getting jquery ajax requests to work, problem seem to be that the request doesn't go to the correct controller method and either returns with all the content for my 404 page or returns the content for the page you are already viewing, putting an extra / before the admin/process didn't help, have posted a simple example have tried a few ajax scripts that are working fine outside codeigniter and all seem to have the same problem any ideas very much appreciated
many thanks
this is the js file
Code:
$(document).ready(function(){
$("#submit_item").click(function() {
var item = $('#itemid').val();
$.post("admin/process", {'item' : item}, function(Data){
$("#contentRight").html(Data);
});
});
});
and this is the controller
Code:
function process() {
$item= 'from controller'.trim($this->input->post('item'));
$array = array('result'=>$item);
echo $array;
}