i am trying to dynamically add items to a listview in jquery mobile via ajax.
When i return the data and append the generated html the new items don't inherit the listview style properties, any help would be greatly appreciated.
$(function() {
$('.load_more').live("click",function() {
var a_id = $(this).attr("id");
var b_id = $(this).attr("data");
if(a_id!='end'){
$.ajax({
type: "POST",
url: "data.php",
data: "aid="+ a_id+"&bid="+b_id,
beforeSend: function() {
$('a.load_more').html('<img src="loading.gif" />');
},
success: function(html){
$("#more").remove();
$("ul#updates").append(html);
$('ul#updates').listview('refresh');
}
});
}
return false;
});
});