-2

我创建了一个应用程序,一个对象(文章)一个动作(读取),我想测试发布,但我总是提交警报“发生错误”。为什么?

头码

<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: http://ogp.me/ns/fb/article#">
  <meta property="fb:app_id" content="xxxxxxxxxx" />
  <meta property="og:type" content="article" />
  <meta property="og:url" content="object_url" />
  <meta property="og:title" content="Tachnomo" />
  <meta property="og:description" content="Drive car" />
  <meta property="og:image" content="https://s-static.ak.fbcdn.net/images/devsite/attachment_blank.png" />

和 javascript

<script type="text/javascript">
  function readnews()
  {
      FB.api(
        '/me/news.reads?article=object_url',
        'post',
        function(response) {
           if (!response || response.error) {
              alert('Error occured');
           } else {
              alert('Drive was successfully published with ID : ' + response.id);
           }
        });
  }
  </script>
4

1 回答 1

0

“object_url”应该是一个编码的 URL,而不是“object_url”这个词。

于 2012-07-17T05:31:23.717 回答