I am using ArcGIS JS API version 3.6. I want to make query task synchronize. While executing query task reaming code will wait until completion of query task.
For example I have shared my code here which contains query layer.
Case 1: In which I am directly executing the code and printing the log in consol window, where you can see before the query task output is displaying ([ATTACH=CONFIG]34724[/ATTACH] screen shot for details)
Case 2: In this case we have used alert (for time delay) in the code then value is getting before query task. ([ATTACH=CONFIG]34725[/ATTACH]screenshot for details)