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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:12:16+00:00 2026-06-03T02:12:16+00:00

My question is probably nooby but I really cannot find an answer actually. I

  • 0

My question is probably nooby but I really cannot find an answer actually.

I want to use abort() method on a specific ajax. However i always use request=$.ajax…for all my requests and the request.abort() cancell ALL my ajax, intead of only the one i want.

Is there a way to point on the right one by naming it or something?
here is my code

request.abort();
request = $.ajax({
url: "getphp/gettooltip.php",
type: "GET",
data: {db : db, id : url.substring(url.lastIndexOf('=')+1)},
dataType: "JSON"
});
request.done(function(msg){
d3lttFillInTooltip(msg,db)
$('#d3ltttooltipdiv').css('visibility','visible');
});

I absolutely need to cancel the last call of this same ajax before running this one.

Any help would be welcome 🙂

  • 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-06-03T02:12:16+00:00Added an answer on June 3, 2026 at 2:12 am

    You need to change your code so that you are not simply assigning request=$.ajax({...}); for every single call. You need some sort of list or mapping of requests. How you implement this depends on when you need to abort requests. For example, if you just wanted to have a stack of requests, so that you could easily abort the last request, you could do something like this:

    var requests = [];
    requests.push($.ajax({
        // request 1
        ...
    }));
    requests.push($.ajax({
        // request 2
        ...
    }));
    requests.push($.ajax({
        // request 3
        ...
    }));
    
    requests.pop().abort(); //aborts request 3
    // or...
    requests.shift().abort(); //aborts request 1
    

    If this doesn’t help you, please provide more info on when you need to abort requests. Bottom line — don’t set request to every single ajax request you make if you want to be able to target specific requests.

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

Sidebar

Related Questions

This is probably a noob question, but I can't seem to find the answer.
Simple question (probably), but I'm buggered if I can find an answer... I have
This is probably a really dumb/noob like question but what is the best method
I know this question is probably stoopid. But I just don't want to cause
This is probably a really noob question, but the fact of the matter is
This surely is a noob question, but I can't find an answer in Doxygen
all. This question probably has a devilishly simple answer but it has kept me
Question is probably pretty basic, but can't find out what's wrong (and it leads
My question is probably simple but I'm a complete newbie. I want to search
Probably a noob question, but I'll go for it nevertheless. For sake of example,

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.