0

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

1
  • I assume you've tried calling it from within the success block (e.g. function(data) { howToPost(data); } ) Commented Apr 16, 2010 at 23:43

2 Answers 2

1

If post you mean call the hotToPost function, then

...
success: function(data) {

    howToPost(data.recordID); //or whatever

}
....

Hope this helps.

Sign up to request clarification or add additional context in comments.

Comments

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

Does that work? Kinda new to jQuery

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.