fetch API
基本的な使い方
fetch('https://sample.com/')
.then( res => res.json() )
.then( data => { console.log(data) })
.catch( error => { console.error(error) })
AJAXとの違い
使い勝手が良いので主流はfetch API
BACKfetch('https://sample.com/')
.then( res => res.json() )
.then( data => { console.log(data) })
.catch( error => { console.error(error) })
使い勝手が良いので主流はfetch API
BACK