https://developer.mozilla.org/zh-CN/docs/Web 
web  开发网站
https://unpkg.com/axios/dist/axios.min.js
axios代码网址
 
 
fetch('./01data.json',{})      //{里面是参数}
        .then(function(response){
            // resolve
            console.log(response);    //看属性ok
            return response.json();
        })
        .then(function(data){
            console.log(data)
        })
        .catch(function(){

        })

 

 


 

 axios:

 

源码:

  // 参数
    // 数据获取
    axios.get('./01data.json',{
        Headers:{
        // 请求参数格式
        } ,
        params:{
            // 参数
            id:1001
        }
        })
        .then(function(response){
            console.log(response.data);
        })
        .catch(function(err){
            console.log(err);
        })

 

 posted on 2021-11-23 10:35  陶小黑  阅读(95)  评论(0)    收藏  举报