jQuery Button Call API

This is a nice and quick note of how to create a button on a web page that will be used to run something.

In this example I am going to be shuffling a deck of cards from the Deck of Cards API.
https://www.deckofcardsapi.com

Very basic, a button on a web page. When clicked the API to shuffle a deck is called. Nothing is returned to the web page. Checking the console we will see it. This can be expanded on later.

This will be done on jsfiddle.net as it allows us to see everything easily for this type of quick testing.
https://jsfiddle.net/1x8fbu5a/

On to the details…

HTML

jQuery

Leave a Comment

Your email address will not be published. Required fields are marked *