Welcome Guest, Not a member yet? Register   Sign In
ajax request with jquery problem
#1

[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;
    
  
}


Messages In This Thread
ajax request with jquery problem - by El Forum - 05-29-2012, 02:29 PM
ajax request with jquery problem - by El Forum - 05-29-2012, 03:07 PM
ajax request with jquery problem - by El Forum - 05-29-2012, 05:00 PM
ajax request with jquery problem - by El Forum - 05-29-2012, 07:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB