问题
I'm trying to test out instafeed.js and I can't get it to load on a simple bootstrap page
Everything on my page loads, including this container, but it's empty with no hint of Instagram code.
I downloaded the instafeed js folder, in my root directory. The working file is in the same folder as this instafeed folder, and the min.js file is in there.
Obviously, my client ID was omitted, but other than that, what could I be doing wrong here?
Here is my current code block pertaining to this:
<head>
<script type="text/javascript" src="instafeed.js-master/instafeed.min.js"></script>
</head>
<div class="container">
<div id="instafeed"></div>
</div>
<script type="text/javascript">
$(document).ready(function() {
var feed = new Instafeed({
clientId: 'myclientid',
limit: '4'
});
feed.run();
});
</script>
回答1:
you need to include your access token as well Get your access token from here : http://instagramwordpress.rafsegat.com/docs/get-access-token/
Here is my sample,
if ($instafeed.length) {
var feed = new Instafeed({
get: 'user',
limit: 8,
userId: userId,
accessToken: accessToken,
template: '<a target="_blank" href="{{link}}"><img src="{{image}}" /><div class="instagram-post-stats"><div class="likes">{{likes}}</div><div class="comments">{{comments}}</div></div><i class="fa fa-instagram"></i></a>',
resolution: 'standard_resolution',
sortBy: 'most-recent',
});
}
feed.run();
});
}
feed.run();
来源:https://stackoverflow.com/questions/50767598/instafeed-js-not-loading