-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsearch-result.js
42 lines (38 loc) · 1.13 KB
/
search-result.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
const showcase = document.getElementById("display-profile");
const club = JSON.parse(sessionStorage.getItem('club'));
function showProfile(userInput,rating, keyword, clubinfo) {
console.log("printing rating");
console.log(rating);
if (rating == -5) {
showcase.innerHTML += `
<div class="return-title">
<h1>Club Not Found</h1>
</div>
`;
}
else {
showcase.innerHTML +=
`<div class = "club-card">
<div class="club-header">
<div class="club-name">
<h1> ${userInput} </h1>
</div>
<div class="club-rating">
<h1> The rating is: ${rating} </h1>
</div>
</div>
<div class="club-keyword">
<h1>Key Word: ${keyword} </h1>
</div>
<div class="club-info">
Club info is: ${clubinfo} </p>
</div>
</div>
`;
}
}
var i;
for (i = 0; i < club.length; i++) {
console.log("printed in loop");
window.showProfile(club[i][0],club[i][1],club[i][2],club[i][3]);
}