jquery循环显示api接口的数据
$(window).load(function(){
$.ajax({
url:"/index/product/hotpro",
method:"post",
dataType: "json",
success:function (json) {
console.log(json);
var html = '';
//拼接数据
$.each(json.data, function(commentIndex, comment){
html += '';
});
$('#product_all').html(html);
}
});
});