lundi 3 août 2015

how add fucntion beforeSend in callback

I have quetion about jquery, how add function beforesend & success this my code :

$("body").on("click","#br-submit-assets", function(e){
        
                var form = $(this).parents("form");
                var btn = $(this);
                
                form.ajaxSubmit(function(ret){

                         $("#loadding").html('<i class="fa fa-spinner fa-pulse"></i>');
      

                        $(".career-notif").parent("div").remove();
                        var html = generate_alert(ret.result.status,ret.result.msg);
                        btn.parent("div").before(html);

                        
                });

                return false;

        });

It's work for me but I want display #loading before send data like :

beforeSend: function () {
     $('#loading').append('<i class="fa fa-spinner fa-pulse"></i>');
},




Aucun commentaire:

Enregistrer un commentaire