版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Android_Mrchen/article/details/83274056
<script src="static/js/jquery-1.7.2.js"></script>
<script type="text/javascript">
$(function(){
$.ajax({
type:"post",
url:"product/alllist.do",
dataType:'json',
success:function(msg){
console.log(msg);
var newshtml="";
for(i in msg.data.list){
newshtml+=' <li class="floor-item">';
newshtml+=' <a href="./list.html?categoryId=100016">';
newshtml+=' <span class="floor-text">'+msg.data.list[i].subtitle+'</span>';
newshtml+=' <img class="floor-img" src="'+msg.data.list[i].mainImage+' "/>';
newshtml+=' </a></li> ';
$("#alllist").append(newshtml);
}
},
error:function(msg){
console.log(msg);
}
});
});
</script>