Problem with 2 ajax calls at once

Thread is closed for posting
2 posts, 0 answers
  1. Silvi
    Silvi avatar
    1 posts
    Member since:
    Jun 2013

    Posted 13 Mar 2014 Link to this post

    I have 2 parallel ajax calls to the server. The requests are independent from each other. The problem is that the second request is waiting for the first request's response. Is it possible to get the second request's response immediately, without waiting the first request's response.
  2. Pavel Kolev
    Pavel Kolev avatar
    26 posts

    Posted 14 Mar 2014 Link to this post

    Hi Silvi,

    jQuery $.when() is exactly what you need:

    $.when( $.ajax("/req1"), $.ajax("/req2")).then(function(resp1, resp2){
        // plot graph using data from resp1, resp2

    Pavel Kolev
    Icenium is now Telerik AppBuilder, and is part of the Telerik Platform. Share what you think about AppBuilder and Telerik Platform with us in our feedback portal, so we can become even better!
Back to Top