Results 1 to 3 of 3

Thread: Facebook Login Button Error

  1. #1

    Default Facebook Login Button Error

    I was implemented facebook login but my code fail to show login button in Sencha framework.Please help me out My code:
    Code:
       Ext.setup({
        onReady: function() {
            var topToolbar = new Ext.Toolbar({
                dock : 'top',
                ui: 'dark',
                title: 'Facebook Login'
            });
    		
    		var FacebookPanel = Ext.create('Ext.Panel', {
       
        items: [
            {
                xtype: 'panel',
                flex: 1,
                html: '<div id="header"><h2>Facebook app for tweet keywords</h2></div><span>Login with facebook</span>',
    '<script>',
          'window.fbAsyncInit = function() {',
            'FB.init({',
              'appId      : '<?= YOUR_APP_ID ?>',',
              'status     : true, ',
              'cookie     : true,'
              'xfbml      : true,'
              'oauth      : true,'
            '});',
    
    
              ' (function(d){',
             'var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}',
             'js = d.createElement('script'); js.id = id; js.async = true;',
             'js.src = "//connect.facebook.net/en_US/all.js";',
             'd.getElementsByTagName('head')[0].appendChild(js);',
           '}(document));',
        '</script>',
    <span>Login with facebook</span>',	 '<div id="fb-root"></div>'
       
    					
        
    			
        	 
       }
            
        ]
    });
    I also want to add facebook login and logout button with username and profile pic

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    You should let the FB.init happen outside of your panel. Then in the painted event of the panel, do the (function(d){ stuff to render it to the panel's body element.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  3. #3
    Sencha User
    Join Date
    Sep 2015
    Location
    Banglore
    Posts
    2

    Default Looks everything confused


Tags for this Thread

Posting Permissions

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