1、首先,这是基于一个jQuery来实现的获取方法-----Ajax()
2、话不多说,上代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<script src="js/jquery-1.11.js"></script>
<script>
var httpUrl = "https://api.apiopen.top/getJoke?page=1&count=10&type=image"
/*
//jQuery的Ajax的GET请求
$.get(httpUrl, function(res) {
console.log(res)
res.result.forEach(function(item, i) {
$("body").append(`<h1>${item.name}</h1>`)
$("body").append(`<h1>${item.text}</h