2016-10-16 40 views

回答

0

您需要用jsonp去使用Client-Side (Implicit) Authentication方法來使用Instagram API。您可以攜帶fetch-jsonp來提出「類似取回」的請求。

<script src="https://cdnjs.cloudflare.com/ajax/libs/fetch-jsonp/1.1.0/fetch-jsonp.min.js"></script> 
    <script> 
    fetchJsonp('https://api.instagram.com/v1/users/self/media/recent/?' + window.location.hash.split('#')[1], { 
    method: 'GET', 
    }).then(response => { 
    response.json().then((json) => { 
     console.log(json); 
    }); 
    }); 
    </script> 
相關問題