-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathindex.html
87 lines (82 loc) · 3.63 KB
/
index.html
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<html>
<head>
<title>Backend 7기 자기소개</title>
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous">
</script>
</head>
<body>
<h1>Backend 7기 자기소개</h1>
<form action="" method="GET">
<div>
<label for="name">이름: </label>
<input type="text" name="name"/>
<button type="submit">누구인가요?</button>
</div>
</form>
<h1 id="header"></h1>
<h2 id="team"></h2>
<div id="matching"></div>
<h2 id="introduce"></h2>
<div id="intro"></div>
<h2 id="experience"></h2>
<div id="exp"></div>
<h2 id="interest"></h2>
<div id="inter"></div>
<h2 id="talk"></h2>
<div id="talking"></div>
<script>
var header = document.getElementById("header");
var href = window.location.href;
var queryString = href.split('?');
if (1 < queryString.length) {
var splited = queryString[1].split('=');
if (1 < splited.length) {
var key = splited[0];
var value = splited[1];
var filename = value + ".json";
$.getJSON(filename, function(json) {
if (json["name"]) {
header.innerText = json["name"];
introduce.innerText = "소개"
var intro = document.getElementById("intro");
intro.innerText = json["introduce"];
var talk = document.getElementById("talk");
talk.innerText = "하고 싶은 말";
var talking = document.getElementById("talking");
talking.innerText = json["talk"];
if (json["experience"]) {
var exp = document.getElementById("experience");
var contents = document.getElementById("exp");
contents.innerText = json["experience"];
exp.innerText = "경험";
}
if (json["interest"]) {
var interest = document.getElementById("interest");
interest.innerText = "흥미";
var contents = document.getElementById("inter");
contents.innerText = json["interest"];
}
if (json["team"]) {
var team = document.getElementById("team");
team.innerText = "팀"
var contents = document.getElementById("matching");
contents.innerText = json["team"];
}
} else {
header.innerText = "이름을 입력해주세요";
}
}).fail(function(){
header.innerText = "자기소개가 없어요.";
});
} else {
header.innerText = "이름을 입력해 주세요";
}
}else{
header.innerText = "이름을 입력해주세요";
}
</script>
</body>
</html>