Ajax callbacks oncomplete, error, success For rails

  1. ajax:beforeSend – fired before the send occurs
  2. ajax:success – fired after the send occurs, contains the response
  3. ajax:complete – fired after the success event
  4. ajax:error – fired when errors are present

                   function(evt, data, status, xhr){
                        //this assumes the action returns an HTML snippet
           }).bind("ajax:error", function(evt, data, status, xhr){
                    //do something with the error here
                    $("div#errors p").text(data);

refernced by stack overflow

detailed link

I am Senior Software Engineer. I love reading, writing, sharing,developing, hiking, movies, trips, mountains, brooks, hills etc.

Posted in JQuery, Ruby on Rails

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: