Welcome Guest, Not a member yet? Register   Sign In
[jQuery/AJAX] Get php function return value
#3

[eluser]weboap[/eluser]
need to send some data (the slug you got from the input) to the function in your ajax call. something like.

Code:
var myslug = $('#myinput1').val();
var myvar = $('#myinput2').val();

var postData = {
  'slug' : myslug,
  'somevar' : myvar
};

$.ajax({
  type: 'POST',
  url: base_url+'content/create_unique_slug',
  data: postData,

  success: function(data) {
    
    alert(data);
  }
});


you will be using $this->input->post(); in this case.

to send them via url you can use

Code:
....
url: base_url+'content/create_unique_slug/' + slug,
....



Messages In This Thread
[jQuery/AJAX] Get php function return value - by El Forum - 05-20-2012, 09:09 AM
[jQuery/AJAX] Get php function return value - by El Forum - 05-20-2012, 10:13 AM
[jQuery/AJAX] Get php function return value - by El Forum - 05-20-2012, 10:44 AM
[jQuery/AJAX] Get php function return value - by El Forum - 05-22-2012, 01:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB