微信公开课
如何看待微信公开课小程序热门讨论「小程序关于fetch方法」
摘要:小程序关于fetch方法
展开:functionfetchURL(url,callback){returnfetch(url).then(function(response){console.log(5+response.status);if(response.status200){returnresponse.json();}}).then(function(data){console.log(data);if(typeofcallbackfunction){callback(data);}});}为什么这个方法走到fetch()的时候就报错了?了解更多