A Facebook dialog box will appear, but always says, “An error has occurred”

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">

...

<head>

...

<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
</head>
<body>
<div id="fb-root"></div>
<fb:like id="fb-like" href="http://www.example.com" layout="button_count" show_faces="false" width="100"></fb:like>

...

myscript.js

FB.ui(
   {
     method: 'stream.publish',
     message: 'getting educated about Facebook Connect',
     attachment: {
       name: 'Connect',
       caption: 'The Facebook Connect JavaScript SDK',
       description: (
         'A small JavaScript library that allows you to harness ' +
         'the power of Facebook, bringing the user\ identity, ' +
         'social graph and distribution power to your site.'
       ),
       href: 'http://github.com/facebook/connect-js'
     },
     action_links: [
       { text: 'Code', href: 'http://github.com/facebook/connect-js' }
     ],
     user_message_prompt: 'Share your thoughts about Connect'
   },
   function(response) {
     if (response && response.post_id) {
       alert('Post was published.');
     } else {
       alert('Post was not published.');
     }
   }
 );

I have a Facebook button on my page that works great.

But when I call the method above from my JavaScript source, the Facebook dialog opens, but displays this error message: FB.ui

**An error occurred. Please try again later.**

This has been repeated for several days since I started trying to implement it.

Not very useful error message.

Any idea what might cause it or how to narrow down the problem?

+3
source share
3 answers

" www.facebook.com/connect/prompt_feed.php www.facebook.com/connect/uiserver.php?method=stream.publish"

http://developers.facebook.com/docs/reference/dialogs/feed/

, .

+2

, , , , . , FB.login publish_stream, .

, , ,

+1

FB.int()? Info

0

Source: https://habr.com/ru/post/1780736/


All Articles