我的页面上有这个IFRAME标记:
<iframe id="poptinSocialIframe" class="poptin-socia-iframe" src="https://www.facebook.com/plugins/page.php?href=https://www.facebook.com/www.popt.in/&tabs=timeline&width=340&height=214&small_header=false&adapt_container_width=true&hide_cover=false&show_facepile=true&tabs=false&appId=1487135378023653" width="340" height="214" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true"></iframe>
我在javascript部分设置了这个:
window.fbAsyncInit = function() {
FB.init({
appId : '1079697562162278',
xfbml : true,
version : 'v2.9',
});
FB.AppEvents.logPageView();
like()
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
function like(){
console.info('leaded');
try{
var page_like_or_unlike_callback = function(url, html_element) {
console.log("page_like_or_unlike_callback");
console.log(url);
console.log(html_element);
}
// In your onload handler
FB.Event.subscribe('edge.create', page_like_or_unlike_callback);
FB.Event.subscribe('edge.remove', page_like_or_unlike_callback);
}catch(err){
console.info(err);
}
}
iframe正在运行。但当我点击&#34;喜欢按钮&#34;事件没有解雇 请帮忙!!!!