title: json array in jquery return data undefined
body: <p>I'm trying to pull data to continously refresh some news from a source</p>
  
  <p>data.php</p>
  
  <pre><code>$fecha = $_GET['fecha'];
  $feed = array();
  
  $result = mysql_query("SELECT * FROM envivo WHERE fecha &gt;= '".$fecha."' ORDER BY fecha DESC");
  $existe = mysql_num_rows($result);
  
  if ($existe != 0) {
  
      while ($data = mysql_fetch_array($result)) {
          $jsondata = array();
          $jsondata['titulo'] = $data['titulo'];
          $jsondata['link'] = $data['link'];
          $jsondata['fuente'] = $data['fuente'];
  
          $feed[] = $jsondata;
      }
  
      echo json_encode($feed);
  }
  </code></pre>
  
  <p>live.php</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head profile="http://gmpg.org/xfn/11"&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
  &lt;title&gt;Live&lt;/title&gt;
  &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  function restults(data) {
      $(data).each(function() {
          $("#envivo").append("&lt;li&gt;Titulo: " + data.titulo + " Link: " + data.link + " Fuente: " + data.fuente + "&lt;/li&gt;");
      });
  }
  $(document).ready(function(){
      var fecha = Math.round((new Date()).getTime() / 1000);
      setInterval(function() {
          $.ajax({
              data: "fecha="+fecha,
              type: "GET",
              dataType: "json",
              url: "data.php",
              success: function(data){
                 restults(data);
              }
          });
      }, 5000);
  });
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div id="envivo"&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>When running index.php, data.php it's called via ajax, and it returns something like this</p>
  
  <blockquote>
    <p>[{"titulo":"Test
    1302662957","link":"http:\/\/www.google.com","fuente":"Zuker"},{"titulo":"Test
    1302662957","link":"http:\/\/www.google.com","fuente":"Zuker"},{"titulo":"Test
    1302662631","link":"http:\/\/www.google.com","fuente":"Zuker"}]</p>
  </blockquote>
  
  <p>Everything fine at this point... now i'll try to retrieve and append that data</p>
  
  <p>on firebug console</p>
  
  <blockquote>
    <p>[{"titulo":"Test
    1302662957","link":"http:\/\/www.google.com","fuente":"Zuker"},{"titulo":"Test
    1302662957","link":"http:\/\/www.google.com","fuente":"Zuker"},{"titulo":"Test
    1302662631","link":"http:\/\/www.google.com","fuente":"Zuker"}]</p>
  </blockquote>
  
  <p>So it's fine... but when using</p>
  
  <pre><code>$(data).each(function() {
      $("#envivo").append("&lt;li&gt;Titulo: " + data.titulo + " Link: " + data.link + " Fuente: " + data.fuente + "&lt;/li&gt;");
  });
  </code></pre>
  
  <p>i'm getting undefined for each value... any ideas?</p>
  
  <p>thanks in advance</p>