1
我試圖觸發FB訂閱事件,但警報不起作用。 像按鈕顯示FB,但是當我點擊按鈕一樣,沒有警報:爲什麼fb.event未被解僱?
代碼:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="facebook.aspx.cs" Inherits="iFrame.facebook" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript" src="//connect.facebook.net/en_US/all.js"></script>
</head>
<body>
<form id="form1" runat="server">
<div>
<iframe src="http://www.facebook.com/plugins/like.php?app_id=&href=www.goal.com"
scrolling="no" frameborder="0" style="border: none; overflow: hidden; width: 47px;
height: 20px;" allowtransparency="true"></iframe>
</div>
</form>
</body>
</html>
<script type="text/javascript">
FB.Event.subscribe('edge.create',
function (response) {
alert('You liked the URL: ' + response);
});
</script>
好的,我可以看到一些代碼plse? – Pindakaas
去這裏:https://developers.facebook.com/docs/reference/plugins/like/ - 當你得到你喜歡的按鈕的代碼時選擇'xfbml'而不是選擇'iframe' – Igy