javascript - "Uncaught TypeError: $ is not a function" with instafeed -
this question has answer here:
- jquery - $ not defined 34 answers
i using instafeed images instagram , show them on website.
here's code:
<script type='text/javascript' src='/js/jquery/jquery.js?ver=1.11.2'></script> <script type="text/javascript"> var feed = new instafeed({ get: 'tagged', tagname: 'test', clientid: '0000000000000000000', limit: 6, after: function () { var images = $("#instafeed").find('a'); $.each(images, function(index, image) { var delay = (index * 75) + 'ms'; $(image).css('-webkit-animation-delay', delay); $(image).css('-moz-animation-delay', delay); $(image).css('-ms-animation-delay', delay); $(image).css('-o-animation-delay', delay); $(image).css('animation-delay', delay); $(image).addclass('animated flipinx'); }); }, template: '<a href="{{link}}" target="_blank"><img src="{{image}}" /><div class="likes">♥ {{likes}}</div></a>' }); feed.run(); </script> <div id="instafeed"></div>
i'm pretty new js , jquery, i'm not sure why error. error on following line:
var images = $("#instafeed").find('a');
seems don't have jquery loaded.
add following before script block
<script src="path jquery file"></script>
and change path point url on server jquery can accessed.
Comments
Post a Comment