社群分享按鈕


簡單紀錄一下常用的社群網站分享按鈕

下面這些方式使用javascript去抓目前頁面的網址,如果不需要的話可以把 '.concat(... ) 替換成分享的網址就好。

方法

facebook

href="javascript:void(window.open('http://www.facebook.com/share.php?u='.concat(encodeURIComponent(location.href))));"

plurk

href="javascript:void(window.open('http://www.plurk.com/?qualifier=shares&status='.concat(encodeURIComponent(location.href)).concat(' ').concat('(').concat(encodeURIComponent(document.title)).concat(')')));"

twitter

href="javascript:void(window.open('http://twitter.com/home/?status='.concat(encodeURIComponent(document.title)).concat(' ').concat(encodeURIComponent(location.href))));"

line

href="javascript:void(window.open('https://social-plugins.line.me/lineit/share?url='.concat(encodeURIComponent(document.title)).concat(' ').concat(encodeURIComponent(location.href))));"
Tags : html