title: return json data in javascript function not working
body: <p>Im new to Ajax and im at the point that i get data.The only thing is i cant return my data i get undefine etc. Here is the code:</p>
  
  <pre><code>function select_aragement(arragament){
      var arrst = arragament;
      var arrsplit = arrst.split("|");
      var periode = arrsplit[0];
      var id = arrsplit[1];
  
      var data =$.ajax({
          type: "POST",
          url: 'ajax/prijzen.php',
          data:{
              id: id,
              periode:periode
          },
          dataType: 'json'
      });
      return data.responseText;
  }
  </code></pre>
  
  <p>In this code, <code>arragement</code> is an array.</p>