Adding the Facebook send button (http://developers.facebook.com/docs/reference/plugins/send/) to my site I found that it only worked in Firefox.

The strange thing is that there were no JS errors at all! I haven't had chance to investigate further but the problem seems to be within the fb.js file (I commented out line 299 where it is added & the send button pinged into life!)

Facebook like buttons worked fine.

Comments

Anonymous’s picture

Process of elimination points to:

  if (typeof(FB) != 'undefined') {
    // Render any XFBML markup that may have been added by AJAX.
    $(context).each(function() {
      var elem = $(this).get(0);
      FB.XFBML.parse(elem);
    });
  }

being the culprit.

Dave Cohen’s picture

View source for your page, and make sure there is only one place with "all.js".

And if that code is the "culprit" can you be specific about what's wrong with it?

Anonymous’s picture

all.js is output within the footer as part of the Drupal.settings js:

....."js_sdk_url":"http:\/\/connect.facebook.net\/en_US\/all.js"}});

However, it is also added above the like/send button (without it the buttons do not show up.).

Apologies for being a bit vague about the code above - I literally just commented out functions within the fb.js file to see which caused the send button to fail.

I'm presuming because the send button is XFBML specific, that the FB.XFBML.parse(elem); is intefering with the send button in some way.

Dave Cohen’s picture

Category: bug » support

However, it is also added above the like/send button

Remove the <script> tags from these places. Restore fb.js to its original state. If there's still a problem, use firebug or something like it to track down javascript errors.

Anonymous’s picture

As I mentioned previously, there are no javascript errors & the button doesn't show up if the script tags are not there.

Dave Cohen’s picture

Do you have an application? Might be related to #1160934: Like Button and other XFBML not working without application

Anonymous’s picture

Yes, the whole site is actually shown within a Facebook Page tab so the application was needed for that.

It was only the send button that wasn't working - it would appear but not actually function (small popup with a textbox to send it out) - the like button next to it was fine

letapjar’s picture

I have the same problem. Using the fb-example contrib module, the send button does not work on initial page load - however, if I re-fresh the page, the button seems to work fine.

Any help resolving this would be appreciated.