2012-09-23 39 views
0

我遇到了facebook开放图表(厨师动作和食谱对象)的问题。我的网址 http://www.webcoachbd.com/tester.html 当我点击“烹饪”时,它显示一条警告“发生错误[对象目的]”。我已经看到了相关的主题并尝试了这些,但问题没有解决。 这是我tester.htmlfacebook打开图谱食谱动作不起作用

<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" 
    xmlns:fb="https://www.facebook.com/2008/fbml"> 
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# rejoanxxxx: http://ogp.me/ns/fb/rejoanxxxx#"> 
<meta property="fb:app_id" content="12xxx" /> 
<meta property="og:type" content="rejoanxxxx:recipe" /> 
<meta property="og:url" content="http://www.webcoachbd.com/tester.html" /> 
<meta property="og:title" content="Sample Recipe" /> 
<meta property="og:image" content="http://www.webcoachbd.com/images/animl136.jpg" /> 


<script type="text/javascript"> 
function postCook() 
{ 
    FB.api(  '/me/rejoanxxxx:cook?recipe:http://www.webcoachbd.com/tester.html', 
    'post', 
    function(response) { 
     if (!response) { 
      alert('Error occurred : No Response'); 
     } else if (response.error) { 
      alert('Error occurred : ' + response.error); 
     } else { 
      alert('Cook was successful! Action ID: ' + response.id); 
     } 
    }); 
} 
</script> 
</head> 
<body> 
<div id="fb-root"></div> 
<script> 
window.fbAsyncInit = function() { 
    FB.init({ 
    appId  : '[123xxxxxxxx]', // App ID 
    status  : true, // check login status 
    cookie  : true, // enable cookies to allow the server to access the session 
    xfbml  : true // parse XFBML 
    }); 
}; 

// 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> 

<h3>Stuffed Cookies</h3> 
<p> 
<img title="Stuffed Cookies" 
    src="http://www.webcoachbd.com/images/animl136.jpg" 
    width="550"/> 
</p> 

<br> 
<form> 
<input type="button" value="Cook" onclick="postCook()" /> 
</form> 

和应用基本设置是 应用程序域:webcoachbd.com 网站的URL:http://webcoachbd.com

我检查我的网址(http://www.webcoachbd.com/tester.html)与facebook调试器,不要显示任何错误或警告。 有没有解决这个问题的方法?请帮忙。

回答

1

发布时,您使用了冒号(:)而不是等号(=)。

更改此:/ME/rejoanxxxx:煮配方 HTTP ...
要这样:/ME/rejoanxxxx:煮配方= HTTP ...

+0

谢谢问题解决了。 –

0

当我点击“厨师”时,它显示一条警告“发生错误[对象对象]”。

警报方法无法显示对象结构,因此您只需在该调试尝试中获得[object Object]

改为使用console.log(response.error),然后查看浏览器的JavaScript控制台,看看实际的错误是什么。