title: Store data in variable from post jquery
body: <p>I've got this code:</p>
  
  <pre><code>function someFunction(something1, something2) {
  
      $.post("execute.php", { someData1: something1, someData2: something2 }, function(data) {
  
          returnData = data;
  
      });
  
      return returnData;
  
  }
  </code></pre>
  
  <p>Post function returns either false or true and I want this someFunction send this information further by return value, but it doesn't work. I'm guessing this return value returns before it posts so there's undefined, but I have no idea what to do about it.</p>