JSON check if no data is available
<p>I am using this code to get data from json.</p>

<pre><code>$.each(data.id, function(index, value){

output += '&lt;li&gt;'+value.title+'&lt;/li&gt;';

}

$('#listview').html(output).listview('refresh');
</code></pre>

<p>Sometimes there are no records to display.</p>

<p>How can I know if there are no records and display an alert example: alert('No records'); ?</p>
