Git Product home page Git Product logo

js-jokester's Introduction

Jokester

Click a button to get a random hilarious dad joke! Check it out.

Instructions

  • Create an HTML file, index.html that links to the jQuery CDN and links to a JS file that you need to make, index.js
  • Your HTML file needs a button with an ID of "get-joke" and a div with an id of "joke".
  • Your JS file should use the document ready function. Inside the document ready function you need to:
    • Add an event listener to the click of the "get-joke" button.
    • When that button is clicked, a callback function should be invoked.
    • You will define this callback function to:
      • Use fetch to make a request to the I Can Haz Dad Joke API at this URL: https://icanhazdadjoke.com/
      • The fetch request needs to include request headers that specify that you are asking for JSON.
      • If the request is successful, a function should be invoked that takes the joke you got back in the response and puts it on thep age in the "joke" div.

js-jokester's People

Contributors

sophiedebenedetto avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

cgyork

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.