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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:31:56+00:00 2026-05-24T09:31:56+00:00

I want 3 ajax functions to be called simultaneously on an onchange event of

  • 0

I want 3 ajax functions to be called simultaneously on an onchange event of a dropdown.

I tried like calling the 2nd function inside if (xmlhttp1.readyState==4 && xmlhttp1.status==200) of the 1st function and 3rd function inside if (xmlhttp1.readyState==4 && xmlhttp1.status==200) of the 2nd function.

But only the 1st function is called ,even second function is not called.
Any other ways to achieve it ?

Below are the functions:

function list1(ob){

    var id= ob;
    var xmlhttp1;

    if (window.XMLHttpRequest){//for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp1=new XMLHttpRequest();
    }else{//for IE6, IE5
        xmlhttp1=new ActiveXObject("Microsoft.XMLHTTP");
    }

    xmlhttp1.onreadystatechange = function(){
        if (xmlhttp1.readyState==4 && xmlhttp1.status==200){
            alert("ajax1");
            list2(id);
        }
    }

    xmlhttp1.open("POST","/ajax/listSites.php",true);
    xmlhttp1.setRequestHeader("Content-type",
                              "application/x-www-form-urlencoded");
    xmlhttp1.send("id="+id);    
}


function list2(obb){

    var idd=obb;
    var xmlhttp;

    if (window.XMLHttpRequest){// for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    }else{// code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }

    xmlhttp.onreadystatechange=function(){
        if (xmlhttp.readyState==4 && xmlhttp.status==200){
            alert("ajax2");
            list3(idd);
        }
    }

    xmlhttp.open("POST","/ajax/access_points_do_actions.php",true);
    xmlhttp.setRequestHeader("Content-type",
                             "application/x-www-form-urlencoded");
    xmlhttp.
        send("sel_system_id="+idd+
             "&action="+'LIST_SLAVE_FOR_ACCESS_POINT'); 

      }

// only alert ajax1 is displayed
  • 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-24T09:31:56+00:00Added an answer on May 24, 2026 at 9:31 am

    You can just chain asynchronous calls like this:

    onchange="Function1(); Function2();"
    

    Update:

    Your code:

    <select id="se" onchange="javascript:list1(this.value); //this is current code
    

    should be something like:

    <select id="se" onchange="Javascript: list1(this); list1(this);">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an AJAX function inside a javascript file and I want it to
I want to run function inside web service (.asmx file) $.ajax({ type: POST, contentType:
I want to extend the ajax function so that whenever it is called an
if i have two functions that been called from ajax and i want to
I want to know how to call Ajax function Recursively. My ajax code is
I want to call an internal function once an ajax call back function is
I want to send base64 string through ajax I encoded it through JavaScript function
I want to send Ajax request to controller, I make like this in the
With a function a div-popover gets called and filled with dynamic data using Ajax,
I want to have a function called for every ajaxComplete call regardless of 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.