0
因此,我使用這個共享按鈕插件的Twitter和麪子書。 但是,我不明白我應該改變什麼來獲得我的網址和我的標題時按下按鈕。 plz幫助。更改共享按鈕的內容
HTML:
<a onclick="Share.facebook('URL','TITLE','IMG_PATH','DESC')"> {sharing is sexy}</a>
<a onclick="Share.twitter('URL','TITLE')"> {sharing is sexy}</a>
JS:
Share = {
facebook: function(purl, ptitle, pimg, text) {
url = 'http://www.facebook.com/sharer.php?s=100';
url += '&p[title]=' + encodeURIComponent(ptitle);
url += '&p[summary]=' + encodeURIComponent(text);
url += '&p[url]=' + encodeURIComponent(purl);
url += '&p[images][0]=' + encodeURIComponent(pimg);
Share.popup(url);
},
twitter: function(purl, ptitle) {
url = 'http://twitter.com/share?';
url += 'text=' + encodeURIComponent(ptitle);
url += '&url=' + encodeURIComponent(purl);
url += '&counturl=' + encodeURIComponent(purl);
Share.popup(url);
},
popup: function(url) {
window.open(url,'','toolbar=0,status=0,width=626, height=436');
}
};
我找到了答案我自己,這是很明顯的,你只是在標籤更改「標題」永遠你想要的東西。我的問題是,我在標籤內使用了一個''',所以它出現了故障:P謝謝! – 2013-03-21 20:55:52