전수민

Show Food List

...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
86 86
87 <!-- Icon Cards--> 87 <!-- Icon Cards-->
88 <div class="row" id="body"> 88 <div class="row" id="body">
89 - <!--<script> 89 + <script>
90 90
91 var queryString = decodeURIComponent(window.location.search); 91 var queryString = decodeURIComponent(window.location.search);
92 queryString = queryString.substring(1); 92 queryString = queryString.substring(1);
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
96 document.write(queries[i] + "<br>"); 96 document.write(queries[i] + "<br>");
97 } 97 }
98 98
99 - </script>--> 99 + </script>
100 <script src="js/showFood.js"></script> 100 <script src="js/showFood.js"></script>
101 </div> 101 </div>
102 102
......
...@@ -3,25 +3,27 @@ ...@@ -3,25 +3,27 @@
3 var entName = ''; 3 var entName = '';
4 var entType = ''; 4 var entType = '';
5 var entPhoto = ''; 5 var entPhoto = '';
6 -var card = '<div class="col-xl-6 col-sm-6 mb-3">'+ 6 +var card = '';
7 -'<div class="card text-white bg-light o-hidden h-100">'+
8 -'<div class="card-body"' + ' style="height:300px; background-size: 100% 100%; background-repeat: no-repeat; background-image:url(' + "'" + entPhoto + "');" + '">' + // place photo
9 -'<div class="mr-5" id="nameDiv">'+entName+'</div>'+ // place name
10 -'<div class="mr-5" id="typeDiv">'+entType+'</div>'+ // place type
11 -'</div>'+
12 -'</div>'+
13 -'</div>';
14 7
15 8
16 for(var i=0; i<entList.size(); i++){ 9 for(var i=0; i<entList.size(); i++){
17 entName = entList[i][name]; 10 entName = entList[i][name];
18 entType = entList[i][type]; 11 entType = entList[i][type];
19 - if(entList[i][photo]==null){ 12 + if(entList[i][photo]==undefined){
20 entPhoto = "noimage.png"; 13 entPhoto = "noimage.png";
21 } 14 }
22 else{ 15 else{
23 entPhoto = entList[i][photo]; 16 entPhoto = entList[i][photo];
24 } 17 }
25 - card+=card; 18 +
19 + var tmp = '<div class="col-xl-6 col-sm-6 mb-3">'+
20 + '<div class="card text-white bg-light o-hidden h-100">'+
21 + '<div class="card-body"' + ' style="height:300px; background-size: 100% 100%; background-repeat: no-repeat; background-image:url(' + "'" + entPhoto + "');" + '">' + // place photo
22 + '<div class="mr-5" id="nameDiv">'+entName+'</div>'+ // place name
23 + '<div class="mr-5" id="typeDiv">'+entType+'</div>'+ // place type
24 + '</div>'+
25 + '</div>'+
26 + '</div>';
27 + card+=tmp;
26 } 28 }
27 document.getElementById("body").innerHTML=card; 29 document.getElementById("body").innerHTML=card;
...\ No newline at end of file ...\ No newline at end of file
......