Answer the question
In order to leave comments, you need to log in
How to make preloader on send_data?
There is an action that, upon request, pumps out a large amount of data. How to let the user know that his request is being fulfilled? AJAX is not an option - send_data doesn't work. In Resque.enqueue send_data doesn't work either. What to do?
Thanks everyone for the replies.
Answer the question
In order to leave comments, you need to log in
You can add to the button:
And also by pressing it with the help of JavaScript, you can turn all the fields into "read-only", and also with the help of the same JavaScript you can display an animated icon (see fa-spin at Font Awesome) and an inscription next to it, they say : "Please wait. Your request is being processed."
Or is it better to do so. Add this to the form:
Next, look at the ID of the form and add a JS handler (CoffeeScript):
$(document).ready ->
$("#form-id").on("ajax:success", (e, data, status, xhr) ->
# Тут какой-нибудь код, когда все хорошо. Передаваемый JSON доступен в data.
).on "ajax:error", (e, xhr, status, error) ->
# Тут какой-нибудь код, когда все очень плохо.
return
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question