wanichanの日記

ちょっとした技術メモ。Microsoft中心。Webサイト管理等にまつわるネタ、サイトの更新情報等を発信中。最終版はwanichan.comに掲載していきます。

mixiイイネ!ボタン設置しようか迷う

mixiチェックボタンは一通り設置するようにはしたんですけども。。。mixiイイネボタンをどうしようか迷ってます。

<iframe src="http://plugins.mixi.jp/favorite.pl?href=自分のサイトのアドレス&service_key=自分のチェックキー" scrolling="no" frameborder="0" allowTransparency="true" style="border:0; overflow:hidden; width:450px; height:80px;"></iframe>

URLはlocation.hrefで行けるんでしょうか? あ、でもエンコードする必要があるから、encodeURIComponent(window.location.href) か何かですよね。Facebookのいいね!ボタンの応用なんでしょうか、たぶん。

一応、私のサイトに設置しているタグは以下の通り。

Googleブックマーク

<a href="javascript:location.href='http://www.google.com/bookmarks/mark?op=edit&bkmk='+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent(document.title)"><img src="http://www.google.co.jp/favicon.ico" width="16" height="16" title="Google Bookmarks に追加" alt="Google Bookmarks に追加" class="left" /></a>

mixiチェックボタン

<a href="http://mixi.jp/share.pl" class="mixi-check-button" data-key="識別キー">Check</a><script type="text/javascript" src="http://static.mixi.jp/js/share.js"></script>

はてなブックマーク

<a class="hatena-bookmark-button" href="javascript:location.href='http://b.hatena.ne.jp/add?mode=confirm&ei=UTF-8&url='+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent(document.title)" title="このエントリーをはてなブックマークに追加"><img src="http://b.st-hatena.com/images/entry-button/button-only.gif" alt="このエントリーをはてなブックマークに追加" width="20" height="20" style="border: none;" /></a>

Twitterのツイートボタン

<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="自分のTwitterアカウント" data-lang="ja">Tweet</a>

Facebookのいいね!ボタン

<script type="text/javascript">
var url = "http://www.facebook.com/plugins/like.php?href=" + encodeURIComponent(location.href) + "&layout=button_count&show_faces=true&width=450&action=like&colorscheme=light";
document.write('<iframe src="' + url + '" allowtransparency="true" style="border: medium none ; overflow: hidden; width: 450px; height: 22px;" frameborder="0" scrolling="no"></iframe>');