How to implement a Like button for my website

I am trying to implement a facebook button like on my site. The first four lines in the code are already on my site after the end of the tag.

To implement the "Like button", I added a second script (line 5 to the end) and launched the application. This gives me an error since

" Microsoft Jscript runtime error: '_ onLoad' is null or not an object "

Please let me know. Thanks

<script type="text/javascript" src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php"></script>
<script type="text/javascript">
    FB.init("myapikey", "xd_receiver.htm", { "reloadIfSessionStateChanged": true });
</script>
<script type="text/javascript">
  window.fbAsyncInit = function() {
    FB.init({appId: 'myappid', status: true, cookie: true,
             xfbml: true});
  };
  (function() {
    var e = document.createElement('script'); e.async = true;
    e.src = document.location.protocol +
      '//connect.facebook.net/en_US/all.js';
    document.getElementById('fb-root').appendChild(e);
  }());
</script>

References: http://developers.facebook.com/docs/reference/plugins/like

<fb:like href="http://webclip.in" layout="standard" show-faces="true" width="450" action="like" font="arial" colorscheme="light"/>
+3
source share
2 answers

.

, http://developers.facebook.com/docs/reference/plugins/like-box

, " "

<iframe 
    src="http://www.facebook.com/plugins/likebox.php?id=185550966885&amp;width=292&amp;connections=10&amp;stream=true&amp;header=true&amp;height=587" 
    scrolling="no" frameborder="0" 
    style="border:none; overflow:hidden; width:292px; height:587px;" allowTransparency="true">
    </iframe>

( Javascript SDK facebook)

<fb:like-box profile_id="185550966885"></fb:like-box>

http://developers.facebook.com/docs/reference/plugins/like Get... thats , javascript .

+4

API div body javascript

< div id = "fb-root" > </div>

""

http://developers.facebook.com/docs/reference/javascript/

+1

Source: https://habr.com/ru/post/1745909/


All Articles