开发者

Facebook app canvas page: Can't see FBML-like button

开发者 https://www.devze.com 2023-03-21 05:49 出处:网络
<!DOCTYPE html> <html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:fb=\"http://www.facebook.com /2008/fbml\">
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com /2008/fbml">
<head>
<style>
body { font: 12px Calibri; }
</style>
</head>
<body>

<fb:like href="http://www.facebook.com/pages/Trololo/236069739747588?sk=app_229260073773183"  width="450" show_faces="false" font="arial">    </fb:like>

<?php
$signed_request = $_REQUEST["signed_request"];
list($encoded_sig, $payload) = explode('.', $signed_request, 2);
$data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true);

if (empty($data["page"]["liked"])) {
//Does not like
} else {
//Likes
}


?>

<div id="fb-root"></div><script src="http://connect.facebook.net/se_SV /all.js#appId=113202612108305&amp;xfbml=1"></script>

<script type="text/javascript">

$(function() {

FB.init({appId: '229260073773183', status: true, cookie: true, xfbml: true});

FB.Event.subscribe('edge.create', function(response) {
    //clicked "like"
});

F开发者_StackOverflow中文版B.Event.subscribe('edge.remove', function(response) {
    //clicked "unlike"
});

});

</script>
</body>
</html>

Test-app url: http://www.facebook.com/pages/Trololo/236069739747588?sk=app_229260073773183

My problem: Can't see the like-button. Did I miss something?

Thanks!


Try putting the fb-root before the php block AND the fb:like element.

<body>
<div id="fb-root"></div><script src="http://connect.facebook.net/se_SV /all.js#appId=113202612108305&amp;xfbml=1"></script>
<fb:like href="http://www.facebook.com/pages/Trololo/236069739747588?sk=app_229260073773183"  width="450" show_faces="false" font="arial">    </fb:like>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号