Sorting listview in javascript <p>I have listview with Title, image and date. I want to sort that list on the basis of date field and then display in html5 page. I used jquery and html5 on this.</p> <pre><code>$j('#task_summary_list').empty(); if (response.totalSize &gt; 0) { $j.each(response.records, function(i, record) { var imgName; switch (record.Priority) { case "High": imgName = "images/prio_high24.png"; break; case "Low": imgName = "images/prio_low24.png"; break; default: imgName = "images/prio_normal24.png"; } // create new list entry for record to the listview $j('&lt;li&gt;&lt;/li&gt;') .attr('id', record.Id) .hide() .append( '&lt;a href="#"&gt;' + '&lt;img src="' + imgName + '" alt="High" class="ui-li-icon"&gt;' + '&lt;h1&gt;' + record.Subject + '&lt;/h1&gt;' + '&lt;p&gt;' + '&lt;strong&gt;' + record.ActivityDate + '&lt;/strong&gt;' + '&lt;/p&gt;' + '&lt;/a&gt;') .click(function(e) { e.preventDefault(); console.log("Under onSuccessTasks " + record.Id); showTaskDetails(record); }) .appendTo('#task_summary_list') .show(); }); } else { $j('&lt;li class="norecord"&gt;No records to display&lt;/li&gt;').appendTo('#task_summary_list'); } $j('#task_summary_list').listview('refresh'); $j.mobile.hidePageLoadingMsg(); </code></pre> <p>Any help is appreciated. Thanks in avance.</p>