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

  • Home
  • SEARCH
  • 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

I know that it's possible to get SVN to send emails after a commit
I know it's not possible to send an ajax request or use GWT's RequestBuidler
just to know, is it possible to send password through an Ajax request safely?
Is it possible to send messages from a PHP script to the console in
I just wonder if it is possible to send Meeting Requests to people without
I have this ajax call at the moment: $.ajax({ url: misc/sendPM.php, type: POST, data:
Is it possible to send an email from my Java application using a GMail
Is it possible to send a UDP broadcast packet to a different subnet through
Is it possible to send an Email with only cc or bcc recipients using
Possible Duplicate: How do you send email from a Java app using Gmail? How

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.