Although its relevance has partially diminished after the onset of other front-end libraries, you can still use jQuery for making asynchronous calls. I mentioned earlier that we can select elements from the DOM with jQuery.
If we wanted to, we could use jQuery to load the quote into multiple elements, with the help of a class, but an id is all we need for now.
Remember, this code assumes the jQuery library has been saved as jquery. Other prominent features of Axios include: Intercept requests and responses.
Transform request and response data using promises. Here is the code for making a basic GET request.
This article was written in and remains one of our most popular posts. For more jQuery functions, check the online documentation or visualjquery.
Therefore, to select the button with the id 'generate' which we gave it abovewe can use the element expression generate. Jesse James Garrett is credited with coining the term in this article. Axios is also popular with modern libraries such as React and Vue.