jQuery Mobile を使用してモバイル アプリを作成していますが、少し問題があります。ajax投稿から取得したデータベースのコンテンツを含むリストを作成したいと思います。
マークアップは次のようになります。
<div data-role="page">
<div data-role="header">
<h1>Facturen</h1>
</div><!-- /header -->
<div data-role="content">
<ul data-role="listview" data-inset="true" id="Invoices">
<div id="invoiceList"></div>
</ul>
</div><!-- /content -->
<div data-role="footer">
<h4>Page Footer</h4>
</div><!-- /footer -->
これはjQueryです:
$.ajax({
type: "POST",
url: "invoices/index.php",
data: '',
complete: function(data)
{
$('#invoiceList').html(data.responseText);
}
});
さて、クエリの結果を間に入れます
これを試してみると、うまくいきました:
<ul data-role="listview" data-inset="true" id="Invoices">
<li>test</li>
<li>test</li>
<li>test</li>
<li>test</li>
</ul>
誰かがこれを修正する方法を知っていますか?
前もって感謝します!