Fredrik Gjärdman
Fredrik Gjärdman

Reputation: 41

IE9 and HTML5 and XFBML like button doesn't work in IE Protected Mode

I had severe problems getting my like button to work in IE9. It works great in Chrome and Firefox but in IE9 when I click Like or Send a new windows opens. I googled the problem and found a few similar posts but nothing that solved my problem. I just noticed that my site and my developer environment are both included in IE trusted sites and thus marked NOT to use Protected Mode. After turning ON Protected Mode it works.

So I go to FB to see if I can report as a bug at http://developers.facebook.com/bugs but can find nowhere to actually post a bug - only browse. So besides of posting this to inform of my finding to other developers - can anyone point me in the right direction for posting a bug report. Tried to google it but noope.

Upvotes: 4

Views: 2168

Answers (1)

ShawnDaGeek
ShawnDaGeek

Reputation: 4150

Everything appears to be working fine on my end.
All i can suggest is

  1. init javascript sdk in async and put its code just below the < body > tag to give it time to load. "It did fail 1 time out of 14 tries is why i suggest. https://developers.facebook.com/docs/reference/javascript/
  2. Use channel html file to speed up loading for Internet explorer.

here is a sample of how i render my login buttons using parse xfbml and async javascript.


<div id="loginbutton"></div>
<div id="fb-root"></div>
<script>
      window.fbAsyncInit = function() {
        FB.init({
    appId  : '135669679827333',
    status : true, // check login status
    cookie : true, // enable cookies to allow the server to access the session
    xfbml  : true, // parse XFBML
    channelUrl : 'https://anotherfeed.com/emo/channel.html', // channel.html file
    oauth  : true // enable OAuth 2.0
        });
function loginbutton(){
var loginb=document.getElementById('loginbutton');
loginb.innerHTML='<div class="fb-login-button" data-show-faces="false" data-width="200" data-max-rows="1" data-autologoutlink="true" data-scope="read_stream,user_likes,publish_stream,publish_actions,read_friendlists,user_photos,user_groups,user_interests,user_videos"></div>';
FB.XFBML.parse(loginb);
};
loginbutton();
      };
  // Load the SDK Asynchronously
(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&appId=135669679827333";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>

Upvotes: 1

Related Questions