Advertisement
GATE-MST

joke api script

Jun 30th, 2023
590
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.33 KB | Source Code | 0 0
  1. // joke api
  2. $("#joke").click(function () {
  3.     console.log("testing joke api");
  4.     var joke_url = "https://official-joke-api.appspot.com/random_joke";
  5.     $.getJSON(joke_url, function (data) {
  6.         $("#exampleModalLabel").text(data.setup);
  7.         $("#punchline").text(data.punchline);
  8.         console.log(data);
  9.     });
  10. });
Tags: api jQuery
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement