ajax - jquery does not deliver paramater to the controller function -


i have following lines of jquery code in codeigniter view file gets form field values , sends them add_emp_performance function in employees controller.

    var emp_id = "<?php echo $this->uri->segment(3); ?>";     var title = $("#title").val();     var date = $("#date").val();     var url = "<?php echo base_url().'index.php/employees/add_emp_performance/';?>"+emp_id;     //alert(emp_id); ---> works fine     //alert(url);  ---> works fine     $.ajax({         type: "get",         //type: "post",         url: url,         //data: 'emp_id='+emp_id+'&title='+title+'&date='+date,         success: function(r){             if(r==1){                 alert("performance saved!");             }else{                 alert("error!");             }         }     });  

controller employees function add_emp_performance :

function add_emp_performance($emp_id){     echo $emp_id ;exit; 

i keep getting following error:

a php error encountered  severity: warning  message: missing argument 1 employees::add_emp_performance()  filename: controllers/employees.php 

what problem? many thanx!

problem missed data options of ajax data posted

 $.ajax({     type: "get",     url: url,     data:{'emp_id':emp_id }, //<---here data posted server     .... 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -