如何在部落格中加入HemiDemi, MyShare,Yahoo分享書籤, delicious,百度收藏,Technorati,YouPush共享書籤按鈕?(一共7個)
常上網的人一定都會用IE的「我的最愛」或Firefox的書籤來蒐集並儲存自己喜歡的網站、常用的或值得珍藏的訊息,而「共享書籤網站」就是一種可以讓大家把自己珍藏的書籤分享出來的「好東西的交換平台」,目前台灣常見的有HemiDemi, MyShare,Yahoo分享書籤…等。
平常我們除了可以到共享書籤網站瀏覽其他人推薦的好文章之外,如果你希望你的部落格或網站的文章可以更容易、更方便的「被」讀者們收藏到HemiDemi, MyShare,Yahoo分享書籤…等共享書籤網站中的話,可以依照下面的方法,在你的部落格版面中新增「共享書籤按鈕」,讓大家可以按一下按鈕,就直接把文章收藏到他常用的共享書籤網站中,也讓你的文章可以更廣泛的被閱讀到。
該怎麼設定呢?其實很簡單,不過還是得有一點HTML的基礎,能看得懂你的網站程式是在寫什麼,才不會放錯位置唷。
以下將我這給個月來蒐集到的共享書籤按鈕的程式碼分享一下,有些可能不是運作得那麼順,不過還算都勉強可用,歡迎取用。(完成後的DEMO範例,就在本文下方那些「加入xxx書籤」的按鈕)
一、7種共享書籤按鈕的程式碼:
下載以下全部程式碼:訪客無法瀏覽此圖片或連結,請先 註冊 或 登入會員 。
網站名稱:HemiDemi黑米共享書籤
網站網址
訪客無法瀏覽此圖片或連結,請先 註冊 或 登入會員 。
程式碼:
複製內容到剪貼板
代碼:
<a href="javascript:desc='';via='';if(document.referrer)via=document.referrer;if(typeof(_ref)!='undefined')via=_ref;if(window.getSelection)desc=window.getSelection();if(document.getSelection)desc=document.getSelection();if(document.selection)desc=document.selection.createRange().text;void(open('http://www.hemidemi.com/user_bookmark/new?title='+encodeURIComponent(document.title)+'&url='+encodeURIComponent(location.href)+'&description='+encodeURIComponent(desc)+'&via='+encodeURIComponent(via)));"><img src="http://briian.com/files/bookmark-icon/HemiDemi.gif" title="加入此網頁到:【HemiDemi】書籤" border="0"></a>
網站名稱:MyShare
網站網址
訪客無法瀏覽此圖片或連結,請先 註冊 或 登入會員 。
程式碼:
複製內容到剪貼板
代碼:
<a href="javascript:(function(){d=document;w=window;t='';if(d.selection){t=d.selection.createRange().text;}else{if(d.getSelection){t=d.getSelection();}else{if(w.getSelection){t=w.getSelection()}}}void(window.open('http://myshare.url.com.tw/index.php?func=newurl&from=mysharepop&url='+encodeURIComponent(location.href)+'&desc='+escape(document.title)+'&contents='+escape(t),'newwin','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=510,height=420'))})();"><img src="http://briian.com/files/bookmark-icon/MyShare.gif" title="加入此網頁到:到智邦【MyShare】書籤" border="0"></a>
網站名稱:Yahoo分享書籤
網站網址
訪客無法瀏覽此圖片或連結,請先 註冊 或 登入會員 。
程式碼:
複製內容到剪貼板
代碼:
<a href="" name="top_save" onclick="window.open('http://tw.myweb2.search.yahoo.com/myresults/bookmarklet?u='+encodeURIComponent(location.href)+'&ei=UTF-8&t='+encodeURIComponent(document.title),'popup','width=520px,height=420px,status=0,location=0,resizable=1,scrollbars=1,left=100,top=50',0)"><img src="../files/images/Yahoo-boolmark.gif" border="0" title="加入此網頁到:Yahoo「分享書籤」"/></a>
網站名稱:百度收藏
網站網址
訪客無法瀏覽此圖片或連結,請先 註冊 或 登入會員 。
程式碼:
複製內容到剪貼板
代碼:
<a href="javascript:u=location.href;t=document.title;c = %22%22 + (window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text);var url=%22http://cang.baidu.com/do/add?it=%22+encodeURIComponent(t)+%22&iu=%22+encodeURIComponent(u)+%22&dc=%22+encodeURIComponent(c)+%22&fr=ien#nw=1%22;window.open(url,%22_blank%22,%22scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes%22); void 0" border="0" title="將此網頁加入【百度收藏】..." ><img src="http://briian.com/files/bookmark-icon/baidu-post.gif" alt="將此網頁加入【百度收藏】..."></a>
網站名稱:del.icio.us 共享書籤
網站網址
訪客無法瀏覽此圖片或連結,請先 註冊 或 登入會員 。
程式碼:
複製內容到剪貼板
代碼:
<a href="javascript: void(window.open('http://del.icio.us/post/?url=' .concat(encodeURIComponent(location.href)) .concat('&title=') .concat(encodeURIComponent(document.title))));"><img src="http://briian.com/files/bookmark-icon/delicious.gif" border="0" title="加入此網頁到【del.icio.us 書籤】" alt="加入此網頁到【del.icio.us 書籤】" /></a>
網站名稱:Technorati
網站網址
訪客無法瀏覽此圖片或連結,請先 註冊 或 登入會員 。
程式碼:
複製內容到剪貼板
代碼:
<a href="javascript:void window.open('http://technorati.com/faves?sub=favthis&add='+escape(document.location))"><img title="technorati" alt="technorati" src="http://briian.com/files/bookmark-icon/Technorati.gif" border="0"></a>
網站名稱:YouPush
網站網址
訪客無法瀏覽此圖片或連結,請先 註冊 或 登入會員 。
程式碼:
複製內容到剪貼板
代碼:
<a href="#save" name="save" onclick="javascript:q=(document.location.href);void(open('http://www.youpush.net/submit.php?url='+escape(q),'','resizable,location,menubar,toolbar,scrollbars,status'))"><img src="http://www.youpush.net/images/yp.gif" alt="加入此網頁到:YouPush" border="0" valign="middle"></a>