ladda-bootstrap icon indicating copy to clipboard operation
ladda-bootstrap copied to clipboard

when using AJAX forms

Open programmer-yang opened this issue 10 years ago • 1 comments

Hello,

I like you to write a tool (Ladda),

But I met a doubt in use,

I found that when using Ajax to submit the form, in the request after the start, I button animation is not working, at the end of a request, this button animation to begin the work, but I'm asking before it has been *.start, so I want to know why he didn't work.

This is my code fragment: image

programmer-yang avatar Jan 05 '15 01:01 programmer-yang

I have the stop method like this and its working.

            $('#add_ub_btn').click(function(){
                var l = Ladda.create(this);
                l.start();
                $.ajax({
                    url: '...',
                    type: "post",
                    data: {.......},
                    success: function(){
                       .......
                    }

                }).always(
                        function() {
                            l.stop();
                        }
                );
            });

nuukcillo avatar Sep 21 '15 12:09 nuukcillo