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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:57:36+00:00 2026-05-18T00:57:36+00:00

I have a script that runs through a multi-level array and each time calls

  • 0

I have a script that runs through a multi-level array and each time calls a new ajax GET command to a php file with part of that array as the data.
Pretty basic…

for(var x=0; x<cities.length; x++){
    for(var u=0; u<links.length; u++){
       $.ajax({
                    url: "dontneedtoknow.php?city=" + cities[x] + "&link=" + links[u],
                    type: 'GET',
                    async: false,
                    cache: false,
                    timeout: 30000,
                    error: function(){
                        return true;
                    },
                    success: function(data){ 
                          //just appending data to page
                    }
                });
   }
}

I’d like to be able to have click() events and the ability to STOP this for loop but when this loop is going I can’t do ANYTHING because of the async false.

I need the async false because I want the data to be appended as each function completes for a reason.

I have tried .live() but that doesn’t seem to work…

Ideas?

  • 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-18T00:57:37+00:00Added an answer on May 18, 2026 at 12:57 am

    When async is false, the entire browser* will be hung. You cannot do anything during a synchronous Ajax call other than waiting for the call to finish.

    If you want to be able to stop the loop, you must use asynchronous calls.

    See also:

    • What does "async: false" do in jQuery.ajax()?
    • IE7 hangs when using (to much) ajax calls with async: false
    • How to make all AJAX calls sequential?

    That last link especially might be useful (if I understand what you’re trying to accomplish here).


    *unless you’re in Chrome (then it’s just the current page)

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

Sidebar

Related Questions

I have a migration that runs an SQL script to create a new Postgres
I have a script that retrieves objects from a remote server through an Ajax
I have a script that runs on the command line, called by a crontab.
I have a PHP script that runs as a CGI program and the HTTP
I have a bash script that runs a simulation program written in Fortran 90,
I have a cron that runs through many rows, deleting the bad ones (according
I have a MSBuild script that I am executing through TeamCity. One of the
I have a script that runs fine in the browser, however fails when run
I have a script that runs on some pages. The problem is that I
I have a jQuery function that runs through the page, finds links to a

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.