socialfeed.js也没有显示但也没有显示错误

时间:2016-05-26 22:17:15

标签: javascript jquery

我正在尝试使用以下内容获取显示内容的基本Feed:socialfeed.js但没有显示内容,也没有出现任何错误。

下面是完整的代码:

<!doctype html>
<html>

<head>
    <meta charset="utf-8" />

    <!-- Social-feed css -->
    <link href="css/jquery.socialfeed.css" rel="stylesheet" type="text/css">
    <!-- font-awesome for social network icons -->
    <link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
</head>

<body>

   <div class="social-feed-container"></div>






    <!-- jQuery -->
    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
    <!-- Codebird.js - required for TWITTER -->
    <script src="bower_components/codebird-js/codebird.js"></script>
    <!-- doT.js for rendering templates -->
    <script src="bower_components/doT/doT.min.js"></script>
    <!-- Moment.js for showing "time ago" and/or "date"-->
    <script src="bower_components/moment/min/moment.min.js"></script>
    <!-- Moment Locale to format the date to your language (eg. italian lang)-->
    <script src="bower_components/moment/locale/it.js"></script>
    <!-- Social-feed js -->
    <script src="js/jquery.socialfeed.js"></script>

    <script>
        $(document).ready(function(){

            $('.social-feed-container').socialfeed({
                twitter:{
                accounts: ['@jquery'],                      //Array: Specify a list of accounts from which to pull tweets
                limit: 2,                                   //Integer: max number of tweets to load
                consumer_key: 'qzRXgkI7enflNJH1lWFvujT2P',          //String: consumer key. make sure to have your app read-only
                consumer_secret: '8e7E7gHuTwyDHw9lGQFO73FcUwz9YozT37lEvZulMq8FXaPl8O',//String: consumer secret key. make sure to have your app read-only
             },

            // GENERAL SETTINGS
                length:400,
                show_media: true,                                     //Integer: For posts with text longer than this length, show an ellipsis.
            });
        });
    </script>

</body>

</html>

任何想法为什么?

1 个答案:

答案 0 :(得分:1)

为了使其成功,我做了以下事情:

1)在控制台中运行:

git clone https://github.com/pavelk2/social-feed/
nano index1.html

2)输入您示例中的代码(不做任何更改)

3)运行webserver 4)通过网络服务器导航到/index1.html(在我的情况下为http://localhost/Open-source/TroubleShootingSF/social-feed/index1.html),我们看到以下内容:The screenshot of Social-Feed working