Reputation: 110950
w jQuery is it possible to bind a success event to a particular form outside of the actual $.ajax, and in a way that doesn't bind to all ajax calls just the one in particular?
Upvotes: 0
Views: 420
Reputation: 42736
Define the function as normal and just pass the name
example
<script>
function submitSuccess(data)
{
}
$.ajax({
....
success: submitSuccess,
...
});
</script>
Upvotes: 1
Reputation: 144862
Of course you can specify a success callback for any call to $.ajax
:
$.ajax({
// ...
success: function(r) {
// Callback code here
}
});
But from how I'm reading your question, I'm not sure this is what you're looking for. How do you currently have the call to $.ajax
hooked up?
Upvotes: 0