MCPcopy Create free account
hub / github.com/codemistic/Web-Development / getJoke

Function getJoke

Randome Joke Genrator/main.js:6–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4getJoke();
5
6function getJoke() {
7 fetch('https://icanhazdadjoke.com/', {
8 headers: {
9 'Accept': 'application/json'
10 }
11 }).then(function(response) {
12 return response.json();
13 }).then(function(data) {
14 const joke = data.joke;
15 jokeText.innerText = joke;
16 });
17}
18
19newJokeBtn.onclick = () => getJoke()

Callers 1

main.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected