【问题标题】:Instafeed.js error after Instagram API UpdateInstagram API 更新后的 Instafeed.js 错误
【发布时间】:2016-07-29 17:12:15
【问题描述】:

按照 Instagram 的 API 更新要求进行更新后,Instafeed.js 陷入困境。

我相信我的所有用户信息和凭据都可以正常工作,但无法解决似乎与更改无关的错误。

Instagram API 更新之前的原始功能应用程序:

http://integrantsightsandsounds.com

使用当前 Instagram 凭据更新的页面会生成错误“ReferenceError:找不到变量:instafeed”

 <script type="text/javascript">
    (function ($) {
        $(function () { //on DOM ready 
              var userFeed = new instafeed({
                target: 'instagram_list',
          get: 'user',
          userId: 1527608886,
                clientID: 'cb4f0f8196b04aaeaa66e2b253d18b0e',
          limit: 25,
          resolution: 'thumbnail'
                            });
                           userFeed.run();
                            $("#instagram_list").simplyScroll({
              startOnLoad: true,
              speed: 1,
              frameRate: 20,
              orientation: 'horizontal',
              direction: 'forwards',
            }); 
                        });
                    })(jQuery);

据我所知,(作为一个对我在做什么一无所知的人)变量并没有改变原来的功能标记,并且不应该受到更新的用户凭据的影响。

测试页面:

http://integrantsightsandsounds.com/instafeedtest/

@ladygargar

【问题讨论】:

  • 测试页面进入 404 页面。
  • 链接已修复,我的错。

标签: javascript instagram-api


【解决方案1】:

看来你有错字。对象应该是 Instafeed 而不是 instafeed(I 是大写)。

【讨论】:

    【解决方案2】:

    您的页面代码中可能缺少 instafeed.js。

    尝试添加:

    <script src="//cdn.rawgit.com/stevenschobert/instafeed.js/master/instafeed.min.js"></script>
    

    在带有凭据等的脚本之前。

    注意:另外,就像@10100111001 回答一样,你必须写new Instafeed 大写I。

    【讨论】:

    • 感谢您的回复。我确实在标题中有脚本的链接。事实上,我什至在尝试完成这项工作的过程中更新了新版本,并注意到在 instafeedjs.com 的当前文档中,Variable new Instafeed 有一个大写 I,而不是之前使用小写 i。两种方式都尝试过,以防变量引用的 Instafeed 在脚本中带有大写 I,但仍然是相同的错误。
    • 您错误地包含它,请查看您的http://integrantsightsandsounds.com/instafeed/instafeed.js 文件。它的 HTML。应该是JS。检查您的浏览器控制台,有一个错误告诉您Uncaught SyntaxError: Unexpected token &lt;,因为它需要 JavaScript,而不是 HTML。试试我的答案链接。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-23
    • 1970-01-01
    • 2015-08-13
    相关资源
    最近更新 更多