Iframeを介してFacebookのようなボタンが必要です。そのために、facebook developerから facebook のようなコードを入手しました。コードはこんな感じでした
<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Freference%2Fplugins%2Flike&send=false" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe>
ここで、URL リンクの代わりにhttp%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Freference%2Fplugins%2Flike
(これが適切な URL かどうかはわかりません)、自分の URL をそのコードに渡したいと思います。そのために、このようなコードを作成しました
<script type="text/javascript">
var str=document.URL;
document.write('<iframe src="//www.facebook.com/plugins/like.php?href='+str+'&send=false" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe>');
</script>
しかし、うまくいきません。それで、誰かが親切にここで何が間違っているのか教えてもらえますか?