title: Jquery return JSON object in a function
body: <p>I'm doing a rowcount with JSON and get an output like this in my php file <code>json_data2.php</code>:</p>
  
  <pre><code>{"limit": [{"rows":"127"}]}
  </code></pre>
  
  <p>Now I'm calling this file using a Javascript/Jquery function and try to get the rows back (127). I pretend to do it like this:</p>
  
  <pre><code>function limit(keyword){
          $.getJSON("json_data2.php?l="+keyword,function(data)
          {
              $.each(data.limit,function(data){
                  var rows = data.rows;
                  return rows;
              });
          });
      }
  </code></pre>
  
  <p>But every time I call the function in the Script I get "undefined". Any pointers?</p>