title: return true or false after ajax post in parent function?
body: <p>I want to return true or false after making this ajax call:</p>
  
  <pre><code>function write_csv(data, path, file) {
  
      $.ajax({
          url: 'functions.php',
          type: 'POST',
          data: {
              operation: 'SAVE_CSV',
              save_path: path,
              save_file: file,
              save_string: data
          },
          success: function(result) {
              console.log('write_file(' + path + file + '); -done');
  
              return true; /* &lt;-- */
  
          }
      });
  }
  </code></pre>
  
  <p>Example use case of what I want:</p>
  
  <pre><code>function make_csv () {
  
      /* 
      |
      V
      */
  
      if (write_csv(my_data, my_path, 'export.csv') == true) {
          go_on();
      }
  
      function go_on() {
          alert('YEAH!');
      }
  
  }
  </code></pre>
  
  <p>I know it's async, but maybe someone has another idea.
  I won't do it with <code>if</code>'s and stuff...</p>