Manav Sarkar

Manav Sarkar

5 Articles Published

Articles by Manav Sarkar

5 articles

How to register a handler to be called when the Ajax request begins using jQuery?

Manav Sarkar
Manav Sarkar
Updated on 20-Jul-2022 585 Views

jQuery is a feature-rich JavaScript library. We can perform a lot of actions with the help of jQuery which would otherwise require writing large pieces of code. It makes DOM manipulation, event handling, animation, ajax, etc. very easy.In this tutorial, we will learn how to register a handler to be called when the first Ajax request begins using jQuery. Ajax requests are typically HTTP requests that are called by the browser for different tasks such as GET, POST, etc. So when the tasks are performed, we can register a handler using the ajaxStart() function of jQuery. This function is always ...

Read More

How to register a handler to be called when all Ajax requests completed using jQuery?

Manav Sarkar
Manav Sarkar
Updated on 20-Jul-2022 1K+ Views

In this tutorial, we will learn how to register a handler to be called when Ajax requests complete using jQuery. Ajax requests are typically HTTP requests that are called by the browser for different tasks such as GET, POST, etc. So when the tasks are performed, we can register a handler using the ajaxComplete() function of jQuery. This function is always triggered when the request is completed.SyntaxUse the following syntax to register a handler after every ajax request −$(document).ajaxComplete(function () {    console.log('Registered handler.') })Explanation − Suppose we have a GET request on an API. When the API returns a ...

Read More

How to check the lock state of a callback list using jQuery?

Manav Sarkar
Manav Sarkar
Updated on 20-Jul-2022 220 Views

In this tutorial, we will learn how to check the lock-state of a callback list using jQuery. The lock is a callback list in jQuery in the current state. We can toggle the lock state so that additional changes cannot be made unless required.SyntaxThe callbacks list is locked and checked as follows −// Get callbacks list at current state var callbacks = $.Callbacks() // Lock the callbacks list callbacks.lock() // Check callbacks is locked or not console.log(callbacks.locked())AlgorithmFirst we receive the callbacks list at the current state using the Callbacks() function.Then we lock it using the lock() function and ...

Read More

How to attach a function to be executed before an Ajax request is sent using jQuery?

Manav Sarkar
Manav Sarkar
Updated on 20-Jul-2022 2K+ Views

In this tutorial, we will learn How to attach a function to be executed before an Ajax request is sent using jQuery. Ajax requests are typically HTTP requests that are called by the browser for different tasks such as GET, POST, etc. So when the tasks are performed, we can register a handler using the ajaxSend() function of jQuery. This event is called by jQuery whenever an ajax request is to be made.SyntaxUse the following syntax to register a handler before an ajax request −$(document).ajaxSend(function () {    console.log('Triggered ajaxStart. Started Request') })We have an Ajax request. Before sending the ...

Read More

How to add the previous set of elements on the stack to the current set in jQuery?

Manav Sarkar
Manav Sarkar
Updated on 19-Jul-2022 323 Views

jQuery is a feature-rich JavaScript library. We can perform a lot of actions with the help of jQuery which would otherwise require writing large pieces of code. It makes DOM manipulation, event handling, animation, ajax, etc. very easy.In this tutorial, we will learn to add the previous set of elements on the stack to the current set. jQuery maintains an internal stack of the changes that are performed to the matched stack. When the DOM traversal functions or methods are called, the new elements are pushed into the stack. So to use previous stack elements, the addBack() method is called.SyntaxWe ...

Read More
Showing 1–5 of 5 articles
« Prev 1 Next »
Advertisements