-
Notifications
You must be signed in to change notification settings - Fork 0
/
jquery.html
83 lines (76 loc) · 2.72 KB
/
jquery.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>jQuery</title>
<link rel="shortcut icon" href="#" type="image/x-icon">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-zCbKRCUGaJDkqS1kPbPd7TveP5iyJE0EjAuZQTgFLD2ylzuqKfdKlfG/eSrtxUkn" crossorigin="anonymous">
<link rel="stylesheet" href="style.css">
<style>
.card-group{
width:80vw;
margin:auto;
}
.card-group .card{
flex:unset;
padding:1rem;
border:0;
}
.card-group .card .card-body{
flex:unset;
padding:0.5rem;
border:1px solid #ccc;
border-radius: 0.5rem;
min-height:15rem;
}
.name{
font-weight: bolder;
border-bottom:1px solid #999;
margin:0.25rem 0;
}
.summary{
border-bottom:1px solid #ddd;
box-shadow: 0 0 5px #ccc;
margin:0.5rem 0;
width:90%;
float:right;
}
</style>
</head>
<body>
<h1 class="header">jQuery</h1>
<div class="title"></div>
<h4></h4>
<ul class="card-group">
</ul>
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-VHvPCCyXqtD5DqJeNxl2dtTyhF78xXNXdkwX1CZeRusQfRKp+tA7hAShOK/B/fQ2" crossorigin="anonymous"></script>
<script src="vanilla.js"></script>
</body>
</html>
<script>
/********************************************************
* 1.api網址 https://kktix.com/events.json
* 2.選擇$.ajax()、$.get()、$.post()其中一種方式
* 3.建立回呼函式(call back function)來處理回應時的各項行為
* 4.建立錯誤處理
********************************************************/
//利用$.ajax()方法傳送請求並取得回應
/* $.ajax(
{
url:'https://kktix.com/events.json',
type:'get',
success:(res)=>{
eventList(res)
},
}
)
*/
//利用$.get()方法傳送請求並取得回應
$.get('https://kktix.com/events.json',(res)=>{
eventList(res)
})
</script>