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 6026547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:27:40+00:00 2026-05-23T04:27:40+00:00

I have ajax request result = $.ajax({ url: ‘/live-sell-search.php?id=123’, success: function(result) { $(‘.results-list’).html(result); }

  • 0

I have ajax request

  result = $.ajax({
              url: '/live-sell-search.php?id=123',
              success: function(result) {
              $('.results-list').html(result);
                }
            });

I call this on change and I am trying to kill previous call if it is in progress with somthing like this

if(result!='undefined'){resul.abort();}

and several variations of this but it is always braking at some point. Can anyone tell me how this can be done?

  • 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-23T04:27:40+00:00Added an answer on May 23, 2026 at 4:27 am

    As other people have stated, you need to start accepting answers.

    Updated

    I use this on a website and it works quite well for me.

    When the onChange event is called, it checks if there is already an AJAX call in affect. If so, it aborts it and starts a new AJAX call.

    Once the AJAX call has completed the xhr variable gets nulled. Simple really.

    var xhr = null;
    
    $("#textbox").change(function(){
    
        if( xhr != null ) {
             xhr.abort();
        }
    
        xhr = $.ajax({
                  url: '/live-sell-search.php?id=123',
                  complete: function( xhr ){
                      xhr = null; // empty xhr object
                  },
                  success: function( data ) {
                      $('.results-list').html( data );
                  }
              });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Ajax request: $.ajax({ url: MyPage.aspx, data: params, success: function(data) { //
I have a very simple ajax request: $.get(url, data) .done(function () { }) .fail(function
I have a jquery ajax request as follows; $.ajax({ type: 'POST', url: 'ajax.php', dataType:
I have this ajax request: $.ajax({ dataType: 'json', error: function(result) { alert('Error: ' +
I have a php function which returns JSON in response to a ajax request
Here is what I have... function checkDB(code, userid) { $(#notice_div).html('Loading..'); $.ajax({ type: POST, url:
I have an ajax request that requests a php script that connects to my
I have the following ajax call: $(#welcome a.close).click(function(e) { $.ajax({ type: GET, url: /visitors/hide_welcome,
I have the following code making a GET request on a URL: $('#searchButton').click(function() {
Ok, normally I have an ajax request wrapper function where I pass the $data

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.