www.webdeveloper.com
Results 1 to 2 of 2

Thread: Why is the div triggered by the Facebook Send button not displaying?

  1. #1
    Join Date
    Jan 2012
    Posts
    74

    Why is the div triggered by the Facebook Send button not displaying?

    Hi,

    For some reason, when I click the Facebook Send button, the button changes its color, as to say it was clicked (this is normal), but the div does not appear.

    I am giving you a simple example below. It doesn't work for me.

    Does anyone know what mistake I made? Thanks a lot

    My code is the following:

    PHP Code:
    <html>
    <
    body>
    <
    div id="fb-root"></div>
    <
    script>(function(dsid) {
      var 
    jsfjs d.getElementsByTagName(s)[0];
      if (
    d.getElementById(id)) return;
      
    js d.createElement(s); js.id id;
      
    js.src "//connect.facebook.net/en_US/all.js#xfbml=1&appId=2769662723*****";
      
    fjs.parentNode.insertBefore(jsfjs);
    }(
    document'script''facebook-jssdk'));</script>

    <div class="fb-send" data-href="http://apple.com"></div>

    </body>

    </html> 

  2. #2
    Join Date
    Nov 2007
    Posts
    432
    1- remove the **** from your appId.
    2- be sure you run it as http:// and not file://.

    For testing, I
    1- created file c:\inetpub\wwwroot\wd\fb-test.html that contains the code you posted above.
    2- ran fb-test.html as file://, the send button did not appear
    3- ran fb-test.html as http://localhost/wd/fb-test.html, the send button did not appear
    4- removed the *** from the appId in the code
    5- ran fb-test.html as http://localhost/wd/fb-test.html, the send button appeared
    6- ran fb-test.html as file://, the send button did not appear

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles