how to get data within the callback funtion of an ajax function using jquery?
<p>As the best option for getting return data from an ajax call was to use a function. In my case below, I called the function returnData() but how do I get this outside this returnData() function?</p>

<pre><code>           var testFile = $("#selection").val(),
           testData = getTestData(testFile); 

           function getTestData(testF) {
           $.getJSON("test.php", {
           fileTest: testF
           }, function (data) {
              $.each(data, function (index, value) {
                if (value != "") {} else {
                 testArray[index] = value;
               }
           });
       });
         returnData(testArray);
      } ​ 
</code></pre>
