1
Facebookのコメントを使用しています。ページURLを自分のデータベースまたはtxtファイルに送信します。私はhelp..Iがcomment.createイベントでページリダイレクトを行わずにアクションを実行
<?php
$protocol = strpos(strtolower($_SERVER['SERVER_PROTOCOL']),'https')
=== FALSE ? 'http' : 'https';
$host = $_SERVER['HTTP_HOST'];
$script = $_SERVER['SCRIPT_NAME'];
$params = $_SERVER['QUERY_STRING'];
$currentUrl = $protocol . '://' . $host . $script . '?' . $params;
?>
マイイベントコードを作成してコード -
ページのURL alot..plzみまし必要です。
<script>
$("document").ready(function(){
//catch like event
FB.Event.subscribe('comment.create', function(href) {
< Code for sending page url to database or txt sholud be here >
});
//catch unlike event
FB.Event.subscribe('comment.remove', function(href) {
alert('You just unliked '+href);
});
});
</script>