title: Javascript: JSON 'for loop'
body: <p>The following Javascript displays in Safari but not Mobile Safari. Can anyone see any bugs?</p>
  
  <pre><code>$("#results").append(data);
  
  var songdata = JSON.parse(data);
  
  var i = 0;
  
  for (i=0;i&lt;=songdata.total;i++)
  {
      alert(i);
      var songhtml = "&lt;ul&gt;&lt;li&gt;&lt;img src=\"" + songdata.data[i].artwork + "\" /&gt;&lt;/li&gt;&lt;li&gt;" + songdata.data[i].title + "&lt;/li&gt;&lt;li&gt;" + songdata.data[i].artist + "&lt;/li&gt;&lt;li&gt;" + songdata.data[i].length + "&lt;/li&gt;&lt;li&gt;" + songdata.data[i].listen + "&lt;/li&gt;&lt;/ul&gt;";
      $("#results").append(songhtml);
  
  }
  </code></pre>
  
  <p>Thanks in advance.</p>