2011-10-10 74 views
1

我想讓用戶可以選擇從facebook標籤內將故事發布到他們的饋送中。我試圖減少代碼的同謀查找錯誤,但即使有這種裸露的骨頭,例如我的錯誤:當我嘗試打開簡單的對話框時,爲什麼我總是收到「API錯誤代碼:191」?

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
<title>300 flaskor!</title> 
<link rel="stylesheet" href="style.css" type="text/css"/> 
</head> 
<body onLoad="publish();"> 

<div id="fb-root"></div> 
<script src="//connect.facebook.net/en_US/all.js"></script> 
<script> 
    FB.init({ 
    appId : 'MYAPPID', 
    status : true, // check login status 
    cookie : true, // enable cookies to allow the server to access the session 
    xfbml : true, // parse XFBML 
    channelURL : '//MYDOMAIN.COM/channel.html', // Channel File 
    oauth : false // enable OAuth 2.0 
    }); 

var publish = function() { 

FB.ui(
    { 
    method: 'feed', 
    name: 'I like turtles!', 
    link: 'http://www.facebook.com/MyFacebookPage', 
    picture: 'http://MYDOMAIN.COM/logo.jpg', 
    caption: 'Like us!', 
    description: 'this is a test dialog' 
    }); 

}; 

</script> 
</body> 

MYDOMAIN.COM添加爲應用程序設置應用程序的域。

+0

[FB連接上的191 Api錯誤]的可能重複(http://facebook.stackoverflow.com/questions/7708992/191-api-error-on-fb-connect) – bkaid

+0

可能重複的[Facebook API錯誤191 ](http://stackoverflow.com/questions/4691782/facebook-api-error-191) – genesis

回答

1

我找到了答案,事實證明這與在應用程序設置中設置網站網址一樣簡單。

相關問題