Search code examples
asp.netfacebookfacebook-like

FB like button doesn't appear


I am trying ot get an FB like button on my website. I have the following code for it. But the like button doesn't show.

<fb:like href="https:\dev3.ticketalternative.com/Events/21558.aspx" send="false" width="200" height="55" show_faces="false" fb-xfbml-state="rendered" class=" fb_edge_widget_with_comment fb_iframe_widget">

   <span style="height: 35px; width: 225px;">

             <iframe id="f29b6759cc" name="f1671ed43" scrolling="no" title="Like this content on Facebook." class="fb_ltr" src="http://www.facebook.com/plugins/like.php?api_key=xxxxxx&locale=en_US&...colorscheme=light;extended_social_context=false" style="border: none; overflow: hidden; height: 35px; width: 225px;">

             </iframe>
   </span>
</fb:like>

Solution

  • Seems like you are using the XFBML version. You need this in your body:

    <div id="fb-root"></div>
    <script>(function(d, s, id) {
      var js, fjs = 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=XXXXXXXX";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));</script>
    

    and

    <html xmlns:fb="http://ogp.me/ns/fb#">
    

    in your html tag.