-
Notifications
You must be signed in to change notification settings - Fork 2
/
searchword.html
47 lines (44 loc) · 1.86 KB
/
searchword.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
<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>검색</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.6.3.min.js" integrity="sha256-pvPw+upLPUjgMXY0G+8O0xUf+/Im1MZjXxxgOcBQBXU=" crossorigin="anonymous"></script>
<script>
function search() {
$.ajax({
type: 'GET',
url: `http://127.0.0.1:8000/dict?title=${$("#title").val()}`,
success: (result) => {
$("#content").text(result[0].content);
}
})
}
</script>
<style>
main {
margin: 0 auto;
max-width: 375px;
}
</style>
</head>
<body>
<main>
<div class="container content">
<div class="form-group mb-3">
<label for="title">용어</label>
<input type="text" class="form-control" id="title" name="title" />
</div>
<div class="text-right">
<button type="button" class="btn btn-primary" onclick="search()">검색</button>
</div>
<br><br>
<p>뜻</p>
<div id="content"></div>
</div>
</main>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN" crossorigin="anonymous"></script>
</body>
</html>