Joke Collection Website - Talk about mood - How JS calls API interface

How JS calls API interface

The materials to be prepared are: computer, html editor and browser.

1. First, open the html editor, create a new html file, such as index.html, and introduce jquery.

2. In index.html

$.get ('request address', function (b) {

document . body . innertext = b;

});

3. The browser runs the index.html page. At this time, the API interface is called through the development tool of F 12.