我在一个 div 标签中有 4 个 img。我正在使用 jquery ajax 从数据库中获取图像源,并希望将源设置为一张一张的 img ..我该怎么做……谢谢
<div class="item " style="width:450px;">
<ul class="thumbnails">
<li class="span13">
<div class="thumbnail" style="margin-left:15px;">
<img src="" alt="">
</div>
</li>
<li class="span13">
<div class="thumbnail" style="margin-left:15px;">
<img src="" alt="">
</div>
</li>
<li class="span13">
<div class="thumbnail" style="margin-left:15px;">
<img src="" alt="">
</div>
</li>
<li class="span13">
<div class="thumbnail" style="margin-left:15px;">
<img src="" alt="">
</div>
</li>
</ul>
</div>
这是从数据库中检索源的代码
$.ajax({
type: "POST",
url: "/WebServices/BannerImage.asmx/GetAllManufactureImage",
contentType: "application/json",
async: false,
success: function (data) {
$.map(data.d, function (item) {
// set the source to image
});
},
failure: function (msg) {
alert(msg);
}
});