title: How do you write to a global function with JQuery and Ajax?
body: <p>I want to return data from a AJAX handler into a global variable. I have tried making the call non asyc. The difficulty I am having is when I create a global variable and I make reference to that global variable the value becomes undefined outside the Ajax request. I have even tried calling a function using my success callback without any luck. Here is what it looks like at the moment. I made the call sync with a previous question being addressed <a href="https://stackoverflow.com/questions/14754619/jquery-ajax-success-callback-function-definition">jQuery ajax success callback function definition</a></p>
  
  <pre><code>config();
  function config()
  {
      var dataBool;
      var db_test;
      $.ajax({asyc: false,
              url: 'config.php',
              dataType: "text",
              data:{db_test:1},
              type: "POST",
              success: dataStuff
      });
      function dataStuff(data)
      {
          dataBool = data;
      }
  
  }
  </code></pre>