Facebook iframe 575px

Author: Eugeniy Marilev
Date of publication: 2014-05-06 10:32:45
It is amazing, but so far we have found a strange behavior of the main page of our web application that was developed for mobile phones. We accused various technologies, put forward various guesses, partly mystical, partly desperate. Application used HTML5, CSS3 and jQuery-Mobile as a navigation engine. The problem was that the wrong orientation was determined by the device (landscape or portrait). In any case, the initial focus was detected as the landscape. As a result of a long investigation the reason has been found to be very interesting. I can't stop to be amazed by that thing inside the Facebook Javascript SDK. I quote:
return {
    width:575,
    height:240
};
In general, this value is used as a minimum (width, height) for the hidden frame, through which many Facebook plugins are run. You can neither remove this frame, nor give it the wanted width, height and visibility. That's strictly enclosed without any description of the constant in the code of SDK... But the problem exists. If you connect the SDK as follows:
<script>
        window.fbAsyncInit = function() {
          FB.init({
            appId: 'applicationID',
            channelUrl: '//mysite.com/channel.html',
            status: true,
            cookie: true,
            oauth: true,
            xfbml; true
          });
      };
 
        // Load the SDK Asynchronously
      (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>
What surprised me too much, and I still completely can not understand, that setting «status» in the usage of the minimum width is to blame. Funny, ha? Yes, it's funny, but the we spent more than 4 searching for that. Feel free to put this option in the «false». There are no new errors found after disabling this flag will initialize the Facebook SDK. After the flag was disabled the operating functions of login, logout, getLoginStatus, etc. work perfectly in all the browsers. It's always like that - there is no choice left for us, ordinary developers, by Facebook programmers - they are forgiven for the similar code. But, we are always happy to this king of a surprise, and the boring winter Monday brightens up with a good laugh in the office... As a conclusion of this topic, I will say this: if you can not do something, do not jump to conclusions, do not blame the technology with which you are unfamiliar, and get to the very core, the sources of errors.. Even if you spend a lot of time. You will gain invaluable experience, which you can not learn from any book or teacher.
Article comments
Comments:
No results found.
Only logged users can leave comments.