views:

35

answers:

2

I have this function

function onclickRowRecord(recordID) { 

     $.ajax({
   type: "POST",
   url: '/file/to/post.to.php' ,
   data: {recordID:recordID}, 
   success: function(data) {

    //how to post this to  function howToPost(recordID) the recordID  

   }
  });        
} 

function howToPost(recordID){
alert(recordID);
}

so how can I get the response from ajax success and post to the other function

A: 
$.ajax({
    type: "POST", url: '/file/to/post.to.php' , data: {recordID:recordID}, success: function(data) {
        alert(recordID)
    } 
});

Does that work? Kinda new to jQuery

Justen
+1  A: 

If post you mean call the hotToPost function, then

...
success: function(data) {

    howToPost(data.recordID); //or whatever

}
....

Hope this helps.

a programmer