Skip to content

Instantly share code, notes, and snippets.

@mildfuzz
Created December 5, 2012 17:23
Show Gist options
  • Select an option

  • Save mildfuzz/4217646 to your computer and use it in GitHub Desktop.

Select an option

Save mildfuzz/4217646 to your computer and use it in GitHub Desktop.
Simple AJAX bindings for Rails remote forms reference
$(document)
.on('ajax:loading', function() {alert("loading!"); console.log(['loading',arguments])})
.on('ajax:success', function(data, status, xhr) {alert("success!"); console.log(['success',arguments])})
.on('ajax:failure', function(xhr, status, error) {alert("failure!"); console.log(['failure',arguments])})
.on('ajax:complete', function() {alert("complete!"); console.log(['complete',arguments])});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment