JavaScript Bind to remote form complete event

I'm using Nprogress to show a loading state for ajax requests on my Rails app. I've accomplished to make it work with all normal ajax calls but I'm now having problems with rails remote forms.

I'm now using this bindings that works great in most cases.

$(document).bind('ajax:before', function(){
  NProgress.start();
}).bind('ajax:complete', function () {
  NProgress.done();
}).bind('ajax:success', function () {
  NProgress.done();
}).bind('ajax:error', function () {
  NProgress.done();
});

My problem is that my js response is replacing the form to show errors and that's what's causing the progress bar to never complete.

My question is if there's any other way to listen for a remote call to be completed or if there is a way to run a kind of after callback on every remote js reponses. Maybe some kind of layouts for js responses?

My js.erb response looks like this

$('.add-form').html("<%= j(render partial: 'partial/path') %>");
Answer:1

In my web site I need to pop up a dummy 'loading' spinning wheel when click a button and vanish after some time. It's just a dummy page. I would be much obliged if anyone can explain how to do such a ...

In my web site I need to pop up a dummy 'loading' spinning wheel when click a button and vanish after some time. It's just a dummy page. I would be much obliged if anyone can explain how to do such a ...

$(document).ready(function(){ var links = $('body').find('a.internal'); links.on('click', function(e){ //pull page with ajax and replace the content with this response //...

$(document).ready(function(){ var links = $('body').find('a.internal'); links.on('click', function(e){ //pull page with ajax and replace the content with this response //...

  1. jquery reset variable
  2. jquery setting width
  3. jquery setting value
  4. reset recaptcha jquery
  5. resetting in jquery
  6. resetting form in jquery
  7. resetting dropdown in jquery
  8. reset form using jquery
  9. resetting textbox in jquery

Ok, so I have multiple inputs that receive UUID codes. So Im using the .each function from jQuery to go one by one and validate the input to be a UUID code. So this is the code that I have until now: ...

Ok, so I have multiple inputs that receive UUID codes. So Im using the .each function from jQuery to go one by one and validate the input to be a UUID code. So this is the code that I have until now: ...

  1. jquery regex test online
  2. jquery regex test is not a function
  3. jquery regex test
  4. jquery regex test pattern
  5. jquery regex test example
  6. jquery regex test string
  7. jquery regex test method
  8. jquery regex test ignorecase
  9. jquery regex valid email
  10. jquery regex match test
  11. jquery regex email test
  12. regex.test jquery not working
  13. jquery regex match vs test

I've wrote a simple 'add page' form to a small CMS I've built and I have a simple preview feature which submits a form and opens the front-end version of the page in a new window. To achieve this up ...

I've wrote a simple 'add page' form to a small CMS I've built and I have a simple preview feature which submits a form and opens the front-end version of the page in a new window. To achieve this up ...

  1. submit form window.open
  2. submit form window.open javascript
  3. form submit window close
  4. form submit window.location
  5. form submit window.location.href
  6. form submit window
  7. form submit window tab
  8. submit form new window
  9. submit form on window load
  10. submit form new window javascript
  11. submit button windows form
  12. submit form popup window
  13. submit form using window.open
  14. submit form modal windows
  15. submit form open new window
  16. submit form to parent window from iframe
  17. javascript form submit window.location
  18. submit form in parent window from popup
  19. submit form in new window jquery
  20. submit form to popup window jquery