How to cancel the current request in Ajax?

devquora
devquora

Posted On: Feb 22, 2018

 

Current request in AJAX is cancelled when the user performs an action which sets of an Ajax request. This can be depicted with the help of auto-complete functionality for a search box where users can be helped with related search terms based on their current input, by making an AJAX request each time they pass a key in search field. The user types faster than the Ajax request and you would want to abort any non-finished requests, before starting the next one.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Ajax Interview Questions

    Explain What is Ajax?

    Ajax is considered to be a developer’s best friend because it offers several benefits to him such as updating the web..

    Ajax Interview Questions

    Differentiate between Synchronous and Asynchronous Ajax requests.

    Synchronous Ajax requests: In this, the script stops and waits for the server to reply before continuing. In web application world, one has to happen after the other, i.e. the interaction between the ..

    Ajax Interview Questions

    List some advantages and disadvantages of using Ajax.

    Ajax is a very easy concept if one has a sound knowledge of JavaScript. It uses JavaScript functions to call methods fro..