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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:40:07+00:00 2026-06-01T18:40:07+00:00

I am making a java servlet page that checks a list of domain names

  • 0

I am making a java servlet page that checks a list of domain names and it checking each name through a jquery ajax request. It works fine except the results are being appended to the DOM out of order. What is the best method to process requests in the requested order but also be asynchronously like a long polling effect. I am new with javascript.

This is the code I am using for the requests:

$.ajax({
    async:true,
    type:'GET',
    url:servlet,
    success:function(data){
        $('p').append(data+"<br>");
    }, 
}); 

I was thinking of sending a sequence number to the java servlet which would return it through JSON but I was wondering if there was a simpler way.

  • 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-01T18:40:08+00:00Added an answer on June 1, 2026 at 6:40 pm

    What I would do is create the containers for the response ahead of time and then bind the callback around it (not actually binding as in the bind() function).

    For example, assuming you have a container something like <div id="container"></div>, you can do the following:

    function makeRequest(something) {
        var target = $("<div></div>");
        $("#container").append(target);
        $.get("", {something: something}, function(data) {
            target.html(data);
        });
    }
    

    It’s a rather bad example in terms of flexibility, but it should illustrate the point. It adds a div to the container before the request is made and then uses that div to push the response into. That means that the divs will be appended in the order the requests are made. You could extend this idea to use styling to make it look like the divs aren’t there until they’re populated, or you could have a “Loading” message in them.

    (Also, the data passing is rather bad with the something parameter, but hopefully you get the point.)

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

Sidebar

Related Questions

I'm making a Java app that receives some names from SQLite and puts them
Im am making an Java SWT program that is required to run on both
I am making a Java application that is stored in a .jar file and
I am making the decision for an embededded database in an upcoming Java servlet
Goal I am making a Java class that will give enhanced usability to arrays,
I am making a java desktop application for billing customers that will be using
I was making a java gui application through netbeans IDE. All was working fine
I'm making a Java console application that needs to send an HTTP request to
I'm making a Java application with an application-logic-thread and a database-access-thread. Both of them
I am having an issue in an interface I am making in Java. It

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.