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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:16:38+00:00 2026-06-11T22:16:38+00:00

I have an Ajax jquery function ($.post) that retrieves json data. One of the

  • 0

I have an Ajax jquery function ($.post) that retrieves json data. One of the ways it gets executed is by keydown ($(‘#lkj’).keyup(function(event)) with a 250 ms delay. One problem however is that the data retrieved is not always up to date. Especially when the user has a high ping towards the server. When i for example type “test”, the jquery .post script will get (depending on my typing speed) executed between two to four times:

  1. t
  2. te
  3. tes
  4. test

Sometimes the instance containing “te” is slow and is last the complete and therefore overwrites the output written by the instance containing “test”. How do I prevent that?

  • 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-11T22:16:39+00:00Added an answer on June 11, 2026 at 10:16 pm

    One technique is using a sequence number with your request, and processing the output only if it matches the latest request sequence number.

    For example:

    var reqSeq = 0;
    

    When making your $.post call:

    reqSeq++;
    $.post('yourserver.com/yoururl?data=X&seq='+reqSeq, function(data) {
    
        // convert from JSON etc..
    
        // check if this response is for the latest request, if not, ignore response.
        if(data.seqNum < reqSeq) return;
    
        // process the response
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a JQUERY AJAX post function that will work if there is one
i have ajax function that looks like this: jQuery.ajax({ type: 'POST', data: { action:
I have a jquery-ajax function that sends data to a php script and the
Hey guys I have an ajax jquery function that receives data from a php
Hi I have the following code with jQuery: function reject(id) { $.ajax({ type: 'POST',
I have a jQuery AJAX function like this: $.ajax({ url: 'crud/clients.php', dataType: 'json', type:
I have an jquery ajax success function which uses a template to put json
I currently have a JQuery Ajax method as below; $.ajax({ type:POST, url: default.aspx/UpdateData, data:
I have this jQuery code that retrieves external content using ajax, without refereshing the
I have written a simple jQuery.ajax function which loads a user control from the

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.