[TYPO3-english] initializing facebook javascript from main page sdk for iframe autoresizing

siddhant tewari siddhant.tewari at gmail.com
Wed Mar 9 06:09:55 CET 2011


hi,
    I want to embed a site managed by typo3 CMS in facebook iframe
application. I want to implement iframe auto resizing in facebook
application , which requires two steps :-

i) Select the iframe resize option in facebook application page.

ii) Set auto resize option when facebook javascript sdk is
initialized. Javascript code for this is



    <script>
      window.fbAsyncInit=function()
            {
        FB.init({appId:'<?=$facebook->getAppId()?>',session:<?=json_encode($session)?>,status:true,cookie:false,xfbml:true});
        FB.Event.subscribe('auth.login',function(){window.location.reload();});
                FB.Canvas.setAutoResize();
      };

      (function()
            {
        var e=document.createElement('script');
        e.src=document.location.protocol+'//connect.facebook.net/en_US/all.js';
        e.async=true;
        document.getElementById('fb-root').appendChild(e);
      }());
        </script>


Please tell where should i put this code as i cannot figure out how to
add ones own javascript functions inside typo3.

Many thanks in advance.

regards
siddhant


More information about the TYPO3-english mailing list