我想知道我是否寫過我的頻道網址。在JavaScript SDK參考https://developers.facebook.com/docs/reference/javascript/;在頻道文件中的部分說:想知道我是否爲facebook javascript sdk編寫了頻道url。
的channelUrl必須是一個完全合格的URL上 您包括SDK匹配的頁面。換句話說,如果您的網站使用www來提供服務,並且您在網頁上修改了 document.domain,則頻道文件域 必須包含www,您必須在channel.html文件中製作相同的document.domain 更改。該協議還必須匹配 。如果您的頁面通過https提供,則您的channelUrl也必須爲 https。請記得使用腳本src的匹配協議作爲 。
這是我的Javascript SDK頁: 注:我放在同一文件夾中channel.html文件作爲我的index.php文件,我不知道這是正確的要麼。
<body>
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '278374582262040', // App ID
**channelUrl : 'localhost/controllers/index.php/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
});
//the rest of the sdk code