Ost*_*yuk 11 javascript facebook initialization oauth
正如标题所述,我的问题是什么是频道文件.
我正在创建一个使用OAuth连接到用户Facebook帐户的Javascript程序.
有一个看起来像这样的初始化脚本
<div id="fb-root"></div>
<script>
// Additional JS functions here
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
xfbml : true // parse XFBML
});
// Additional init code here
};
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
</script>
Run Code Online (Sandbox Code Playgroud)
那么在channelUrl中我会将其设置为什么?这是什么意思?提前致谢!
小智 3
您可以在下面找到频道 URL 参数的说明。
https://developers.facebook.com/blog/post/530/
它详细说明了为什么要包含该参数,但下面确实是最重要的部分。
异步加载是另一种简单的策略,它允许页面快速加载,而不会阻止页面其他元素的加载。
| 归档时间: |
|
| 查看次数: |
8423 次 |
| 最近记录: |