Reputation: 2249
Since ujs is assigning the event handler by simply including the jquery ujs source, how do I override any of the $.ajax settings for the specific call?
So many examples use the global methods. Is this just the preferred method?
(I asked an earlier question where I thought all the customisation was available through the data-* attributes.)
Upvotes: 2
Views: 218
Reputation: 1390
You can bind to a specific element's AJAX success by:
$element.bind("ajax:success", function(xhr, data, status){
doSomeStuff();
});
Upvotes: 1