简单的脚本,不确定错误的来源。想想我有我的眼罩!
<script type="text/javascript">
var listingId = "<!-- TMPL_VAR listing_id -->";
var photoCount = "<!-- TMPL_VAR photo_count -->";
var photoNum = 1;
for(i=photoNum; i<=photoCount; i++) {
$('.carousel-inner').append('<div class="active item"><img src="/property/photo/' + listingId + '/' + i'" /><div class="carousel-caption"><!-- TMPL_VAR remarks_general --></div></div>');
}
</script>
答案 0 :(得分:1)
您在此行中缺少+
$('.carousel-inner').append('<div class="active item"><img src="/property/photo/' + listingId + '/' + i'" /><div class="carousel-caption"><!-- TMPL_VAR remarks_general --></div></div>');
试试这个
$('.carousel-inner').append('<div class="active item"><img src="/property/photo/' + listingId + '/' + i+'" /><div class="carousel-caption"><!-- TMPL_VAR remarks_general --></div></div>');
答案 1 :(得分:-1)
首先,我可以看到你在src属性的img标签上缺少+
。在+
i
var listingId = " TMPL_VAR listing_id";
var photoCount = "<!-TMPL_VAR photo_count";
var photoNum = 1;
for(var i=photoNum; i<=photoCount; i++) {
$('.carousel-inner').append('<div class="active item"><img src="/property/photo/' + listingId + '/' + i+'" /><div class="carousel-caption"><!-- TMPL_VAR remarks_general --></div></div>');
}