Download AJAX/02_Axios.html from zxy0307/JavaWeb: direct link, hf CLI and curl.
- Browser
- Download file 1.38 kB
-
https://huggingface.co/zxy0307/JavaWeb/resolve/main/AJAX/02_Axios.html
- Command line
-
hf download hf://zxy0307/JavaWeb/AJAX/02_Axios.html
-
curl -L -o 02_Axios.html https://huggingface.co/zxy0307/JavaWeb/resolve/main/AJAX/02_Axios.html
1.38 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Ajax-Axios</title> | |
| <script src="js/axios-0.18.0.js"></script> | |
| </head> | |
| <body> | |
| <input type="button" value="获取数据GET" onclick="get();"> | |
| <input type="button" value="删除数据POST" onclick="post();"> | |
| </body> | |
| <script> | |
| function get() { | |
| //通过axios发送异步请求-get | |
| /* | |
| axios({ | |
| method: "GET", | |
| url: "http://yapi.smart-xwork.cn/mock/169327/emp/list" | |
| }).then(result => { | |
| console.log(result.data); | |
| }) | |
| */ | |
| axios.get("http://yapi.smart-xwork.cn/mock/169327/emp/list").then(result => { | |
| console.log(result.data); | |
| }) | |
| } | |
| function post() { | |
| //通过axios发送异步请求-post | |
| /* | |
| axios({ | |
| method: "POST", | |
| url: "http://yapi.smart-xwork.cn/mock/169327/emp/deleteById", | |
| data: "id=1" | |
| }).then(result => { | |
| console.log(result.data); | |
| }) | |
| */ | |
| axios.post("http://yapi.smart-xwork.cn/mock/169327/emp/deleteById", "id=1").then(result => { | |
| console.log(result.data); | |
| }) | |
| } | |
| </script> | |
| </html> |