-
14 Aug 2012 3:36 AM #1
Facebook like button
Facebook like button
Hi,
I am new to sencha. I have to create a Facebook like button in an already existing sencha app.
I have this link https://developers.facebook.com/docs.../plugins/like/
but I don't know how to use it.
Please can anybody give me a small example.
-
14 Aug 2012 4:03 AM #2
Hi!
sample steps to like google.com :-
1.Include the JavaScript SDK on your page.
2.Place the code for your plugin wherever you want the plugin to appear on your page.Code:<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"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script>
Code:<div class="fb-like" data-href="http://google.com" data-send="false" data-width="450" data-show-faces="true"></div>
sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.
-
14 Aug 2012 5:21 AM #3
thanks but I am still facing some problems
I added javascript sdk in my index.html file inside <body> tag
now I need like button as a xtype:button in a panel
therefore I have created a new panel in a separate js file and added buttons . Now when I click on Facebook button it should behave as Facebook like button. Please advice.
I also tried
but nothing is appearing in that panelCode:items:[ { html:'<div class="fb-like" data-href="http://google.com" data-send="false" data-width="450" data-show-faces="true"></div>' },
-
14 Aug 2012 4:18 PM #4
I have tried this to show a facebook like button but nothing is showing. Please guide me to correct approach
Code:MyApp.views.appEmpfehlenPopup = new Ext.Panel({ config: { title: "LikeUs", layout: 'fit', listeners: { show: function() { (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"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); }}, items: [{ xtype:'container', html: '<fb:like href="http:// raahede.com/blog/2010/10/06/adding-facebook-like-buttons-to-your-website.aspx" layout="button_count" show_faces="false" colorscheme="light">test</fb:like>' }] } });


Reply With Quote