1
Ajax代碼:不在AJAX中顯示警報視圖?
$.ajax({
type:"post",
url:"<?php echo base_url()?>index.php/myad/filter",
data:{checkbox:checked},
success:function(data){
data = $.parseJSON(data);
var list = '';
var cates = '';
var base_url = "<?php echo base_url();?>";
console.log(data);
for(var i = 0; i <= data.length; i++){
list =+ '<div class="col-sm-12"><div class="product-view row" style="border-bottom:1px solid #eee;margin-bottom:20px;padding:20px 0px 20px 0px;background:#f1f1f1"><div class="col-sm-3 col-md-3 col-lg-3"> <div class="large-image"> <img alt="#" src="'+base_url+'/uploads/'+data[i]['checkbox'][0]['Image']+'"><div class="image-title"><span class="icon-thumbs-up" onclick="thumb('+data[i]['UniqueID']+',this)" style="font-size:24px;"></span></div></div></div><div class="col-sm-6 col-md-6 col-lg-6"> <div class="product-label"><h4>'+data[i]['FullName']+', '+data[i]['Area']+'</h4><h5 style="font-size:14px;width: 100%;text-overflow: ellipsis;overflow: hidden;white-space: nowrap;"><span class="icon-calendar"></span> '+data[i]['SaleDate']+'</h5><h5 style="font-size:14px;width: 100%;text-overflow: ellipsis;overflow: hidden;white-space: nowrap;"><span class="icon-clock"></span> ';
var starttime = data[i]['StartTime'];
var endtime = data[i]['EndTime'];
var times='';
for(var r = 0; r < starttime.length; r++){
times+=''+starttime[r]+'-'+endtime[r]+' ';
}
list+=times+'</h5><div data-balloon-length="fit" data-balloon="'+data[i]['Address1']+'" data-balloon-pos="up" ><h5 style="font-size:14px;width: 100%;text-overflow: ellipsis;overflow: hidden;white-space: nowrap;"><span class="icon-home"></span> '+data[i]['Address1']+'</h5></div><div data-balloon-length="fit" data-balloon="'+data[i]['description']+'" data-balloon-pos="up" ><h5 style="font-size:14px;width: 100%;text-overflow: ellipsis;overflow: hidden;white-space: nowrap;"><span class="icon-file"></span> '+data[i]['description']+'</h5></div></div></div><div class="col-sm-3 col-md-3 col-lg-3"><div class="product-label"><h4>CATEGORY</h4>';
for(var j = 0;j < data[i]['checkbox'].length; j++){
cates+='<h5 style="font-size:14px">'+data[i]['checkbox'][j]['Product']+'</h5>';
}
list+=cates+'</div></div></div></div>';
alert("for loop is end");
};
alert('loop is end');
}
});
}
它循環顯示的警報end.but不顯示環的警報到底該如何解決呢?提前致謝,並對任何語法錯誤感到抱歉。