Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3344386
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:03:48+00:00 2026-05-18T01:03:48+00:00

i am making a ajax request using $.get as soon as the user types

  • 0

i am making a ajax request using $.get as soon as the user types a character in the input box
i want to abort the previous ajax calls and then make the new one, is there a way?

edit

solved!

i just found out that $.get is a shorthand way to $.ajax and hence it returns a XHR and so we can call abort on that variable.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T01:03:49+00:00Added an answer on May 18, 2026 at 1:03 am

    You can use .abort() on XMLHttpRequest that $.get returns.

    var req = $.get('ajax/test.html', function(data) {
                $('.result').html(data);
                alert('Load was performed.');
              });
    
    //Abort request
    req.abort()
    

    From jQuery.ajax() documentation:

    The $.ajax() function returns the XMLHttpRequest object that it creates. Normally jQuery handles the creation of this object internally, but a custom function for manufacturing one can be specified using the xhr option. The returned object can generally be discarded, but does provide a lower-level interface for observing and manipulating the request. In particular, calling .abort() on the object will halt the request before it completes.

    More on .abort(): XMLHttpRequest.abort()

    There is also jQuery plugin AjaxQueue for handling multiple Ajax request made in parallel.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making this simple get request using jquery ajax: $.ajax({ url: https://app.asana.com/-/api/0.1/workspaces/, type:
I am making request calls using $.ajax, with post. The problem is, the post
I am making a simple ajax request using jquery . Below is my ajax
i am making ajax calls with jquery like this http://pastie.org/860837 and sometimes i get
I am making an ajax request using JQuery that looks like this: var data
I'm following this tutorial about making an Ajax request on Rails: http://net.tutsplus.com/tutorials/javascript-ajax/using-unobtrusive-javascript-and-ajax-with-rails-3/ made _form
I make an AJAX request like so using JQuery: $.ajax({ type: GET, url: getvideo.php,
I'm making serious asp.net mvc ajax request using Ajax.ActionLink. But requesting same url from
I make an ajax request using jquery, this calls the following spring controller: @RequestMapping(value
I have a Fundamental question in using Jquery with PHP when making ajax calls

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.