I’m experiencing an odd behavior. I’m using Facebook’s feed dialog javascript (FB.ui). It was working a week ago, but now it’s not. When I click on a button, the Facebook window shows up, but after loading for a little time, it automatically disappears without any error messages. Any ideas? Here’s my code below:
HTML:
<a href="#" class="button" id="fb-request">Share with friends</a>
JavaScript:
$("#fb-request").click(function () {
FB.ui({
method: 'feed',
name: 'Check out website',
link: 'http://www.website.com',
picture: 'http://website.com/f8.jpg',
caption: 'A website.',
description: 'website.',
message: 'website'
},
function (response) {
if (response && response.post_id) {
alert('Post was published.');
} else {
alert('Post was not published.');
}
}
);
});
It turns out in recent weeks, Facebook introduced a CSS class=”loading” in the FB.ui dialogs. It conflicted with our own “loading” class in CSS. After 10+ hours of debugging, we were finally able to fix it. Great job FB. ;-(