fetch用法
fetch("./00 data.json", {})

then   response
then   data
 
.then(function (response){
            //    resolve
            console.log(response);
            return response.json();
})      //   第一个固定的不能改动
 
.then(function (data){
            console.log(data);
})   //   从第二个开始是参数,有写,没有就不写  ()里写参数
 
.catch(function (){
            // reject
 });
posted on 2021-11-24 13:47  银小兔  阅读(41)  评论(0)    收藏  举报