tags:

views:

47

answers:

1

i make different queries with php and jquery and get the results with .ajax() when all queries return their values. what i want to do is to get those values as soon as they are ready. now user has to wait until all the queries are done, but the first query returns its value 30 seconds before the second one, so i dont want the user to wait to see all results at once, i want them to see the result just the result returns. how can i do this?

A: 

If you are waiting for multiple database queries to return, you may consider breaking up your web services into multiple AJAX calls. In other words, make 2 AJAX requests, one for the first query and another for the second query (which gets its value 30 seconds after the first). That way you can return the first query back to the page and display it - or whatever needs to be done - while waiting for any additional AJAX calls.

Of course you can extend this technique to additional AJAX requests as needed.

Justin Ethier
i will do that as a last chance, if any other ways won't work.