Sync AJAX call

Job ID: 32520955

Budget: $30 – $250 USD

My problem; I want to make a synchronous call to AJAX, but of course without using "async = false", because this feature is deprecated.

My situation:
I have a js function, which makes a JSON call to a PHP Servlet. ($.getJSON("Servlet_Object.php",{...)
This Servlet contains a SQL querry to a database.
The SQL query returns an array A1.
This array A1 is returned from the Servlet via "echo json_encode($dataarray); "
The js function get A1, and returns this value.

Now I want that the value returned by the js function is the array A1. This implies that the system has somewhereto wait until the completion of the AJAX call before finishing the execution of the js function.
Related categories: PHP JavaScript AJAX MySQL