Created
December 8, 2010 08:41
-
-
Save takimo/733043 to your computer and use it in GitHub Desktop.
mixiのイイネをチェックキーだけ取得すればページに埋め込めるんじゃないか
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
/* チェックキーをserviceKeyに設定する */ | |
(function(){ | |
var writeFavoriteButton = function(){ | |
var serviceKey = "xxxxxxxxxx"; | |
var url = encodeURIComponent(location.href); | |
var html = '<iframe scrolling="no" frameborder="0" allowTransparency="true" style="overflow:hidden; border:0; width:450px; height:80px" src="http://plugins.mixi.jp/favorite.pl?href=' + url + '&service_key=' + serviceKey + '&show_faces=true&width=450"></iframe>'; | |
document.write(html); | |
} | |
if(document.readyState){ | |
writeFavoriteButton(); | |
} | |
if(document.addEventListener){ | |
document.addEventListener("DOMContentLoaded", writeFavoriteButton); | |
}else if(document.attachEvent){ | |
document.attachEvent("onreadystatechange", writeFavoriteButton); | |
} | |
})(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
document.writeはレンダリングを止めちゃうからな。。