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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:22:01+00:00 2026-05-26T23:22:01+00:00

i need to get 4 request from the server, i have stored all this

  • 0

i need to get 4 request from the server, i have stored all this 4 urls in this way. for information this is raw url (http://www.earthtools.org/timezone/40.714352/-74.0059731);

var nationZone = {
    getNewYorkLocalTime :  'getTime.php?lat=40.7143528&lan=-74.0059731',
    getLondonLocalTime : 'getTime.php?lat=51.5001524&lan=-0.1262362',
    getChennaiLocalTime :  'getTime.php?lat=13.060422&lan=80.249583',
    getBangaloreLocalTime:'getTime.php?lat=12.9715987&lan=77.5945627'

}

this is calling my getTime.php and retrieving the result.

for that, i created this for in loop, but this prints only one time intead of 4 times? how can i make this to call 4 request ?

for(zone in nationZone ){
    if (window.XMLHttpRequest){
        zone=new XMLHttpRequest();
    }else{
        zone=new ActiveXObject("Microsoft.XMLHTTP");
    }
    zone.onreadystatechange=function() {
        if(zone.readyState==4 && zone.status==200){
            alert(zone.responseText);
        }
    }
    zone.open("GET",nationZone[zone],true);
    zone.send();
}

I do not mind using a solution that involves an additional third party library

  • 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-26T23:22:01+00:00Added an answer on May 26, 2026 at 11:22 pm

    You can try this if your using jQuery, but I doubt about it to work, because cross domain ajax is not allowed.

    var nationZone = {
        getNewYorkLocalTime :  'getTime.php?lat=40.7143528&lan=-74.0059731',
        getLondonLocalTime : 'getTime.php?lat=51.5001524&lan=-0.1262362',
        getChennaiLocalTime :  'getTime.php?lat=13.060422&lan=80.249583',
        getBangaloreLocalTime:'getTime.php?lat=12.9715987&lan=77.5945627'
    
    }
    
    $.each(nationZone , function(key, value){
        $.get(value, function(response){
            alert(response);
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I desperately need to be able to get some information from the request array
I need to invoke an initial GET HTTP request with Basic Authentication . This
I need to find a way to get all Apache running request at a
I need to get connect with https url, send my request schema and I
I need to find a way to get at the request/response streams inside of
I need get all items these have no categories int? categoryId = null; var
I receive a get request from server, but is encrypted with a simple algorithm
I need to do a CURL request from Server A to Server B .
If I have a relative path that I need to get from the current
I need to use a GET request to send JSON to my server via

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.