"success" is a callback function that is executed when you receive successful response for your AJAX request. I assume that you understand this as you have mentioned it in your post.
May be answer to the question below will help us to resolve your issue -
Can you tell us the requirement to put that "alert" statement? I think it is just a debug mechanism that you may have implemented.
As Bear has mentioned there are two alerts. I assumed that you are talking about second one.
Why block? Use the success callback to perform any operations that need to wait for the response.
Joined: Aug 25, 2009
Bear Bibeault wrote:Why block? Use the success callback to perform any operations that need to wait for the response.
Its returning me undefined... please look the above script i poted.. i used callback
but it was returning me as of async request
Joined: May 14, 2004
You may need to check if you are getting expected values for the data that is being passed to the Ajax endpoint.
As there are places where you are accessing property of an object accessed using jQuery, they can throw "undefined" in case the JS object is not present.