title: Jquery $.post return data
body: <p>With a Jquery $.post can the returned data be an array or return 2 sets of data?</p>
  
  <p>Example: </p>
  
  <pre><code>$.post("MyScript.php", { action:"run" },function(data){
      alert(data);
  });
  </code></pre>
  
  <p>Now this simple post above posts an action to a php script which does 2 functions and returns the data which is then displayed in an alert box.  But my php script performs 2 functions and need to do different things with each of the returned data.  </p>
  
  <p>So in essence Im asking if the $.post can return 2 sets of data like this: </p>
  
  <pre><code>$.post("MyScript.php", { action:"run" },function(data1, data2){
      alert(data1);
      $("div1").html(data2);
  
  });
  </code></pre>
  
  <p>or can the return data be an array where I can assign by values to elements of the array in the php script?</p>
  
  <p>Im hoping this makes sense.</p>