-
Notifications
You must be signed in to change notification settings - Fork 0
/
rccg.html
50 lines (40 loc) · 1.18 KB
/
rccg.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
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="rccg.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro&display=swap" rel="stylesheet">
</head>
<body>
<div style=" text-align: center">
<h2 >Random Chinese character generator</h2>
<button type="button" onclick="loadCharacter()">Generate</button>
</div>
<h2 style=" text-align: center">Generated:</h2>
<div style=" text-align: center" id="generated">
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
function loadCharacter()
{
$.ajax(
{
type: "GET",
url: "https://su14n7n1r0.execute-api.us-east-1.amazonaws.com",
success: function (s)
{
let g = document.getElementById('generated');
g.innerHTML = JSON.stringify(s);
},
error: function(request, ajaxOptions, thrownError)
{
console.log(err);
let g = document.getElementById('generated');
g.innerHTML = 'failed';
}
});
}
</script>
</body>
</html>