jQuery > Ajax methods

.ajaxSend() - perform operation at ajax send in jQuery

How to perform certain operations when ajax request is about to send in jQuery?


To perform certain operations while ajax request is about to send, ajaxSend() method can be used.

<script>
         $(document).ajaxSend(function () {
            $("#divAjaxSend").text("ajaxSend: Sending ajax request ...: " + v);
        });
    </script>

In the above code snippet, when ajax request is about to send, “Sending ajax request …” will be written inside the “divAjaxSend” div element. This event can be used to show progress messages or perform any activity.

 Views: 4698 | Post Order: 113



Write for us






Hosting Recommendations