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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:19:25+00:00 2026-05-16T20:19:25+00:00

Is it possible to send Ajax requests to two or more Php scripts simultaneously?

  • 0

Is it possible to send Ajax requests to two or more Php scripts simultaneously? I know that this can be achieved serially (getting response from 1 and then getting response from the other) but I am wondering is it possible simultaneously. Please assist me with the following code:

function calShowUpload(){
    if (http.readyState == 4) {
        res = http.responseText;
        document.getElementById('maincontent').innerHTML=res;
    }
}

function showUpload(obj)
{
      http.open("GET", "./showUpload.php", true);
    http.onreadystatechange = calShowUpload;
    http.send(null);
}


function getXHTTP() {
    var xhttp;
    try {   // The following "try" blocks get the XMLHTTP object for various browsers…
            xhttp = new ActiveXObject("Msxml2.XMLHTTP");
        } 
    catch (e) {
            try {
            xhttp = new ActiveXObject("Microsoft.XMLHTTP");
            } 
        catch (e2) {
         // This block handles Mozilla/Firefox browsers...
                try {
                    xhttp = new XMLHttpRequest();
                } 
            catch (e3) {
                    xhttp = false;
                }
            }
        }
    return xhttp; // Return the XMLHTTP object
}

var http = getXHTTP(); // This executes when the page first loads.

In the above example I know that I can call another function like showUpload(obj) inside calShowUpload() to achieve my objective, but I need something like this:

function showUpload(obj)
{
      http.open("GET", "./showUpload.php", true);
      http.open("GET", "./showDelete.php", true);
    http.onreadystatechange = calShowUpload;
    http.send(null);
}
  • 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-16T20:19:26+00:00Added an answer on May 16, 2026 at 8:19 pm

    You need two instances of the XMLHttpRequest or the second will stomp the first. The very, very easiest way to do this with your existing code is simply to create two instances and write your JS to use whichever one is appropriate to the task.

    var http1 = getXHTTP(); // Use this for one request.
    var http2 = getXHTTP(); // Use this for the other request.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, so I want to send AJAX requests to my website from my Flash
My Javascript needs to send some data to a server when the page closes,
I'm trying to do some caching using VaryByParam AND VaryByHeader. When an AJAX request
I'm wondering how it's implemented in Gmail, that every time you receive e-mail, the
I've to write an Ajax chat web application in ASP.NET for a friend, and
I'm sure we've all worked on, or are aware of web applications (especially in
I want to time how long it takes the server to build a MediaWiki
I need some help from some linux gurus. I am working on a webapp
Web-Applications these days make extensive use of Javascript, for example various Google Products like
I am trying to use a COMET solution using ASP.NET . Trouble is I

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.