2013-09-21 47 views
2

我是新来的Facebook开发。我有一个移动应用程序,我需要连接到Facebook。我正在使用Facebook JavaScript SDK进行身份验证。那么它在桌面浏览器和Chrome移动设备上的工作情况良好,但是当我尝试在IE10移动版上运行我的应用程序时,该应用程序被重定向到“m.facebook.com/dialog/oauth?app_id = .....”并且它表示“ IE移动不支持此功能。请使用其他浏览器'。只有在我的手机上尚未登录Facebook时才会发生这种情况。如果已经登录重定向已正确完成。以下是我的代码Facebook登录对话框不能在IE10手机中工作

$.ajaxSetup({ cache: true }); 
     $.getScript('//connect.facebook.net/en_US/all.js', function() { 
      window.fbAsyncInit = function() { 
       FB.init({ 
        appId: 'xxxxxxxxxxxxx', // App ID 
        channelUrl: 'xxxxxxxxxxxxxxx'l', // Channel File 
        status: true, // check login status 
        cookie: true, // enable cookies to allow the server to access the session 
        xfbml: true // parse XFBML 
       }); 

       FB.Event.subscribe('auth.authResponseChange', function (response) { 
        // Here we specify what we do with the response anytime this event occurs. 
        if (response.status === 'connected') { 
          $('#fb_connect').text('Disconnect').trigger("updatelayout"); 
        } 
        else if (response.status === 'not_authorized') { 
         //do something 
               } 
         else {      
         alert('not connected, click connect button to login') 

        } 
       }); 
      $('#fb_connect').on('click', function (e) { 
       e.preventDefault(); 
       e.stopImmediatePropagation(); 

       FB.login(function (response) { 
        if (response.authResponse) { 
         $('#fb_connect').text('Disconnect').trigger("updatelayout"); 

        } else { 
         // The person cancelled the login dialog 
        } 
       }); 

帮助非常需要。 谢谢。

回答

2

我在调试时遇到了完全相同的问题,问题是必须在IE中更改安全属性: Internet选项 - >安全 - >然后底部的“启用保护模式”复选框有要启用,那么它将工作。

相关问题