How to chain ajax calls using jquery
问题 I need to make a series of N ajax requests without locking the browser, and want to use the jquery deferred object to accomplish this. Here is a simplified example with three requests, but my program may need to queue up over 100 (note that this is not the exact use case, the actual code does need to ensure the success of step (N-1) before executing the next step): $(document).ready(function(){ var deferred = $.Deferred(); var countries = [\"US\", \"CA\", \"MX\"]; $.each(countries, function