我将如何在下面的代码中添加 href 和 listview 标头。如果我在 html 部分添加它,我不会得到下面的列表 html 和 js
<script type="text/javascript">
$(document).on("pagebeforeshow", "#index1", function() {
$(function(){
var items="";
$.getJSON("check-events.php",function(data){
$.each(data,function(index,item)
{
items+="<li>"+item.enddate+"</li>";
});
$("#contacts").html(items);
$("#contacts").listview("refresh");
});
});
});
</script>
<div data-role="fieldcontain">
<ul id="contacts" data-role="listview" data-divider-theme="b" data-inset="true">
</ul>
</div>
我在哪里放这个
<li data-role="list-divider" role="heading">
List view
</li>