전수민

Show Food List

......@@ -86,7 +86,7 @@
<!-- Icon Cards-->
<div class="row" id="body">
<!--<script>
<script>
var queryString = decodeURIComponent(window.location.search);
queryString = queryString.substring(1);
......@@ -96,7 +96,7 @@
document.write(queries[i] + "<br>");
}
</script>-->
</script>
<script src="js/showFood.js"></script>
</div>
......
......@@ -3,25 +3,27 @@
var entName = '';
var entType = '';
var entPhoto = '';
var card = '<div class="col-xl-6 col-sm-6 mb-3">'+
'<div class="card text-white bg-light o-hidden h-100">'+
'<div class="card-body"' + ' style="height:300px; background-size: 100% 100%; background-repeat: no-repeat; background-image:url(' + "'" + entPhoto + "');" + '">' + // place photo
'<div class="mr-5" id="nameDiv">'+entName+'</div>'+ // place name
'<div class="mr-5" id="typeDiv">'+entType+'</div>'+ // place type
'</div>'+
'</div>'+
'</div>';
var card = '';
for(var i=0; i<entList.size(); i++){
entName = entList[i][name];
entType = entList[i][type];
if(entList[i][photo]==null){
if(entList[i][photo]==undefined){
entPhoto = "noimage.png";
}
else{
entPhoto = entList[i][photo];
}
card+=card;
var tmp = '<div class="col-xl-6 col-sm-6 mb-3">'+
'<div class="card text-white bg-light o-hidden h-100">'+
'<div class="card-body"' + ' style="height:300px; background-size: 100% 100%; background-repeat: no-repeat; background-image:url(' + "'" + entPhoto + "');" + '">' + // place photo
'<div class="mr-5" id="nameDiv">'+entName+'</div>'+ // place name
'<div class="mr-5" id="typeDiv">'+entType+'</div>'+ // place type
'</div>'+
'</div>'+
'</div>';
card+=tmp;
}
document.getElementById("body").innerHTML=card;
\ No newline at end of file
......