Javascript FB评论插件-检测页面上的评论
如何使用Comments插件在我的页面上检测评论?我目前正在使用Facebook PHP SDK,阅读Facebook文档,上面说我需要JS SDK,但不清楚如何实现我的目标。我想这是直截了当的:Javascript FB评论插件-检测页面上的评论,javascript,facebook,facebook-javascript-sdk,facebook-comments,Javascript,Facebook,Facebook Javascript Sdk,Facebook Comments,如何使用Comments插件在我的页面上检测评论?我目前正在使用Facebook PHP SDK,阅读Facebook文档,上面说我需要JS SDK,但不清楚如何实现我的目标。我想这是直截了当的: <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({ appId : 'YOUR_APP_ID', // App ID
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'YOUR_APP_ID', // App ID
channelURL : '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
oauth : true, // enable OAuth 2.0
xfbml : true // parse XFBML
});
FB.Event.subscribe('comment.create',
function(response) {
alert('A new comment has been added!');
}
);
};
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
</script>
window.fbAsyninit=函数(){
FB.init({
appId:'你的应用程序ID',//应用程序ID
channelURL:'//WWW.YOUR_DOMAIN.COM/channel.html',//频道文件
状态:true,//检查登录状态
cookie:true,//启用cookie以允许服务器访问会话
oauth:true,//启用oauth 2.0
xfbml:true//解析xfbml
});
FB.Event.subscribe('comment.create',
功能(响应){
警报('已添加新注释!');
}
);
};
//异步加载SDK
(职能(d){
var js,id='facebook jssdk';if(d.getElementById(id)){return;}
js=d.createElement('script');js.id=id;js.async=true;
js.src=“//connect.facebook.net/en_US/all.js”;
d、 getElementsByTagName('head')[0].appendChild(js);
}(文件);
文档:-我想这是直截了当的:
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'YOUR_APP_ID', // App ID
channelURL : '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
oauth : true, // enable OAuth 2.0
xfbml : true // parse XFBML
});
FB.Event.subscribe('comment.create',
function(response) {
alert('A new comment has been added!');
}
);
};
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
</script>
window.fbAsyninit=函数(){
FB.init({
appId:'你的应用程序ID',//应用程序ID
channelURL:'//WWW.YOUR_DOMAIN.COM/channel.html',//频道文件
状态:true,//检查登录状态
cookie:true,//启用cookie以允许服务器访问会话
oauth:true,//启用oauth 2.0
xfbml:true//解析xfbml
});
FB.Event.subscribe('comment.create',
功能(响应){
警报('已添加新注释!');
}
);
};
//异步加载SDK
(职能(d){
var js,id='facebook jssdk';if(d.getElementById(id)){return;}
js=d.createElement('script');js.id=id;js.async=true;
js.src=“//connect.facebook.net/en_US/all.js”;
d、 getElementsByTagName('head')[0].appendChild(js);
}(文件);
文件:-可能的副本