为什么这个脚本没有启动?

时间:2013-05-21 22:06:54

标签: javascript jquery

我正在尝试安装社交共享栏jquery脚本。出于某种原因,它没有加载,我似乎无法找到原因。

在网站的负责人中,我将jquery与jquery脚本一起加载,就像它声明的那样:

<script type="text/javascript" src="http://www.moviepostersdb.com/js/jquery.min.js"></script>
<script type="text/javascript" src="http://www.moviepostersdb.com/js/jquery.social.share.2.2.js"></script>

脚本安装还要求在头部添加一些额外的脚本:

<script type='text/javascript'>
$(document).ready(function($){
$('#social-share').dcSocialShare();
size: 'horizontal',
    location: 'bottom',
    offsetAlign: 0,
    offsetLocation: 0,
    buttons: 'twitter,facebook,linkedin,digg,stumbleupon,delicious,pinterest,xing,buffer,print,email',
    floater: false,
    autoClose: true
});
});
</script>

这也是实施的。

在正文结束标记之前,安装程序还要求实现以下代码...再次,我也这样做了:

<div id="social-share"></div>

尽管如此,由于某种原因......社交边栏没有出现在网站上。任何人都可以看到可能出错的地方吗?

www.movi​​epostersdb.com&lt; ---网站的网址。

2 个答案:

答案 0 :(得分:5)

看起来你有语法错误。

$('#social-share').dcSocialShare();
                                 ^-- closed here

我认为你的意思是:

$(function(){
    $('#social-share').dcSocialShare({
        size: 'horizontal',
        location: 'bottom',
        offsetAlign: 0,
        offsetLocation: 0,
        buttons: 'twitter,facebook,linkedin,digg,stumbleupon,delicious,pinterest,xing,buffer,print,email',
        floater: false,
        autoClose: true
    });
});

答案 1 :(得分:0)

它应该是:

$(function(){
 $('#social-share').dcSocialShare({
    size: 'horizontal',
    location: 'bottom',
    offsetAlign: 0,
    offsetLocation: 0,
    buttons: 'twitter,facebook,linkedin,digg,stumbleupon,delicious,pinterest,xing,buffer,print,email',
    floater: false,
    autoClose: true
 });
});

所以$('#social-share').dcSocialShare();错误关闭