New Bie : json を使用してデータベースから取得し、format
リストビューに表示するリスト データがあります。しかし、リストビューの選択されたインデックスを取得する方法をまだ混乱させています。これは私のコードです:
<script>
function loadListTips(){
$('#message').html('Loading...');
$.ajax({
type: 'get',
url: "http://10.0.2.2/compfest/ajax/belajar/list_tips.php",
success: function(response){
var html = '';
$.each(response, function(index,item){
html += '<li>';
html += '<a>';
html += '<span class="judul">' + item.judul + '</span>';
html += '</a>';
html += '</li>';
});
$('#penyakit_list').html(html);
$('#penyakit_list').listview('refresh');
$('#message').html('');
},
error: function(e){
alert('Error: ' + e);
}
});
}
</script>
誰かが私を助けてくれることを願っています。