我有一个带有多个facebook按钮的网页。我想知道用户在FaceBook中点击这个JQuery函数的按钮:
FB.Event.subscribe('edge.create',
function (response) {
//$(this) doesn't seem to work...
});
我的Facebook按钮代码:
(function(d,s,id){ var js,fjs = d.getElementsByTagName(s)[0]; if(d.getElementById(id))返回; js = d.createElement(s); js.id = id; js.src =“//connect.facebook.net/en_US/sdk.js#xfbml=1&appId=745992962098989&version=v2.0”; fjs.parentNode.insertBefore(js,fjs); }(document,'script','facebook-jssdk'));
<div class="fb-like" style="display: inline-block; vertical-align: middle;" data-href="http://10.134.216.25:8009/Vraag?vraagId=@item.vraagID" data-layout="button" data-id="@item.vraagID" data-action="like" data-show-faces="false" data-share="true"></div>
我需要能够从包含按钮
的div中读取data-id