我正在使用jquery mobile在移动应用上工作。我想在面板中显示图像以及描述和标题。
标题和描述以及图像在JSON文件中定义,如下一步:
var GpsData = [
{
"id": "13",
"name": "Sahrij",
"latitude": "34.046902",
"longitude": "-4.9963",
"altitude": "384",
"description": ".....",
"type": "medersa",
"image": "assets/imgs/sud.jpg"
}
在JS文件中我定义了id:
$("#poi-detail-title").html(marker.poiData.title);
$("#poi-detail-image").html("<img src='" + marker.poiData.image + "'/>");
$("#poi-detail-description").html(marker.poiData.description);
标题和说明工作正常,但图片未显示:(
<div data-role="content">
<!-- title -->
<h3 id="poi-detail-title"></h3>
<!-- description -->
<h4 id="poi-detail-description"></h4>
<!-- distance -->
<h4>Distance: <a id="poi-detail-distance"></a></h4>
<!-- image don't think is correct!!!!-->
<div id="poi-detail-image"><img></div>
</div>
我猜错了是在内容div!