2013-05-21 51 views
0

我想安裝一個社交分享欄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 < ---網站的URL。

+1

這是PHP? – hexacyanide

+0

似乎你剛剛複製了JavaScript的隨機部分,並期望它神奇地工作。這在嚴峻的現實中不會發生。 – zerkms

+2

@zerkms:不;他使用的是一個jQuery插件。 – SLaks

回答

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 
    }); 
}); 
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();是一個錯誤的密切

相關問題