0
그래서이 공유 버튼 플러그인을 사용하여 트위터와 페이스 북에 사용합니다. 그러나 단추를 누를 때 URL과 제목을 변경하려면 무엇을 변경해야하는지 이해할 수 없습니다. 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');
}
};
플러그인은에서 찾을 수 있습니다 http://www.webdesign.org/html-and-css/tutorials/how-to-create-a-share-button-for-your-site.22180.html
나는 대답을 발견했다. 내 자신, 그것은 분명했다, 당신은 그냥 태그의 'TITLE'을 당신이 원한 것으로 바꾼다. 내 문제는 내가 태그 안에'''를 사용했기 때문에, 그것은 엉뚱한 것이었다 : P 어쨌든 고맙다;) –