-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
29 lines (28 loc) · 807 Bytes
/
index.html
File metadata and controls
29 lines (28 loc) · 807 Bytes
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
<!DOCTYPE html>
<html>
<head>
<title>Joke API</title>
<script src=""></script>
<script>
function getJoke() {
$.ajax({
url: 'Invoke_URL/joke',
type: 'GET',
success: function (response) {
document.getElementById('joke-setup').textContent = response.setup;
document.getElementById('joke-punchline').textContent = response.punchline;
},
error: function (xhr, status, error) {
console.log(error);
}
});
}
</script>
</head>
<body>
<h1>Random Joke Generator</h1>
<button onclick="getJoke()">Get Joke</button>
<div id="joke-setup"></div>
<div id="joke-punchline"></div>
</body>
</html>