Update a list dynamically with database values
i'm trying to create a list using jquery mobile where the data is dynamically loaded from a database. i tried to echo out each list item, but the formatting completely breaks when i do this. here's my js code:
$.get('file.php', function(data) {
$("#quest").html(data);
$('ul').listview('refresh');
});
here's the php:
echo "<li class='poll_item' id='poll_".$id."'>
<h3><a href='#'>".$question."</a></h3>
<p><strong>blababl</strong></p>
<p>blablabla</p>
<p class='ui-li-aside'><strong>6:24</strong>PM</p>
</li>";
and here's the html:
<ul data-role="listview" id="quest"></ul>
i also tried printing this in a div including the <ul>, but that didn't work either. the only thing that worked was printing just the $question inside the <a>, but this is not sufficient for what i'm doing.
thanks in advance.