Consuming RESTful services with jQuery

JQuery is a fast, light, and powerful JavaScript library; it eliminates DOM-related complexity by providing direct access to HTML elements once the DOM three has been loaded. To use jQuery within an HTML document, you have to import it:

<script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.min.js "></script>

Assume that somewhere within an HTML document, there is a button defined as <input type="button" id="btnDelete" value="Delete"/>.

To assign a function to the click event of this button with JQuery means we need to do the following:

  1. Import the jquery library in the HTML document
  2. Assure that the DOM document of the HTML document is completely loaded
  3. Access the button using the identifier ...

Get RESTful Web API Design with Node.js 10 - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.