16.[Vue入门]axios
Github
完整代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>axios</title>
</head>
<body>
<input type="button" value="Get请求" class="get">
<!-- <script src="https://unpkg.com/axios/dist/axios.min.js"></script> -->
<script src="https://unpkg.com/axios@0.21.1/dist/axios.min.js"></script>
<script>
// get
// https://autumnfish.cn/
document.querySelector(".get").onclick = function () {
axios.get("https://autumnfish.cn/search?keywords=%E6%B5%B7%E9%98%94%E5%A4%A9%E7%A9%BA")
.then(function (response) {
console.log(response);
}, function (err) {
console.log(err);
})
}
</script>
</body>
</html>
16.[Vue入门]axios
https://元气码农少女酱.我爱你/5fb208022850/