tags:

views:

303

answers:

2

I am going absolutely batty trying to figure out how to get showAddSectionButton to work.

The problem: I'm trying to get the 'add section button' to show up. There is nothing showing up right now.

My code:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" >
  <body>
    <div id="s1"></div>

    <script type="text/javascript" src="{{ fb_js }}"></script>
    <script type="text/javascript">

    window.onload = function() {
      FB_RequireFeatures(["XFBML"], function() {
        FB.Facebook.init('{{ api_key }}','{{ receiver_path }}', null);
        FB.Connect.showAddSectionButton("profile", document.getElementById("s1"));
      });
    };
    </script>
    <div id="s2"></div>
  </body>
</html>

Stuff I've tried:

  1. Copy-pasted the code from the working Facebook example app Smiley and made only the minimal changes to customize it to my settings
  2. Manually checked to make sure all of the links (js library, xd_receiver) work
  3. receiver_path is a relative path
  4. confirmed that the facebook js include is supposed to be in the body of page

I'm pretty new at firebug, but I've taken a poke around, and it looks like the facebook js has re-written the HTML, specifically, there is an iframe inside of the [div id="s1"][/div] which looks like it should be a button.

Unfortunately, I don't see anything displayed.

Any help would be greatly appreciated.

Platform: google app engine, python

A: 

Did you get this going? I am having the same problem.

Thanks, Chris

A: 

I did finally figure out the problem.

Facebook doesn't allow anything but FBML on the profile page (for some reason I thought I could use an iframe), which means you have to call setFBML with the profile_main property filled first.

Once I did that, the button popped right up.

Theodore Nordsieck

related questions