【问题标题】:My Facebook Connect .php webpage works on Chrome, Firefox, IE9 but not on IE8. It shows up as a blank white screen我的 Facebook Connect .php 网页适用于 Chrome、Firefox、IE9,但不适用于 IE8。它显示为空白的白色屏幕
【发布时间】:2011-10-16 01:47:04
【问题描述】:

我开发了一个可以在 Chrome、Internet Explorer 9 和 Mozilla 中运行的应用程序,但在 Internet Explorer 8 中没有运气。即使没有通过 Facebook,我在 Internet Explorer 中也会出现空白屏幕。奇怪的是,如果我查看页面源代码,我可以看到所有源代码。在FB里还是一样的白屏。

我正在使用 IE8。我发现的一切都可以追溯到 P3P 策略。每个站点都说要制定一个策略,以便 cookie 可以通过并且会话将运行。

这是我找到的link

是的,这些已经实施。包括 FB 在他们自己的网站上使用 HONK hack 来绕过 IE 3rd 方 cookie 安全问题。

是的,我已经成功地更改了隐私设置。

有人知道这有什么问题吗?代码如下所示:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html id="facebook" lang="en" xmlns="http://www.w3.org/1999/xhtml">

<head>

<!-- START Init Facebook App -->

<div id="fb-root"></div>      

<script src="http://connect.facebook.net/en_US/all.js"></script>      

<script>

FB.init({ 

  appId:'298230576859720', 

  cookie:true, 

 status:true, 

 xfbml:true,

  authResponse:true,

 oauth : true    });



 </script>

 <!-- END Init Facebook App -->



 <script type="text/javascript">



 // START Facebook JS Feed Pop Up Code 

  function FBRoutine(){ // If user isn't already authenticated or logged in get authentication



  FB.getLoginStatus(function(response) {           

      if (response.authResponse) {

            // logged in and connected user, someone you know

            //alert ('authed already');

            // alert (response.status);

            // FBFeed(); // Show feed pop up

            window.location = "facebook-step-03-optin.php";

      } else {

            // no user session available, someone you dont know

            //alert ('not authed');

            //alert (response.status);

            window.location = "facebook-step-02-login.php";                

      };



   }); // End getLoginStatus

}; // End function

// END Facebook JS Feed Pop Up Code 

FBRoutine(); // Run routine to detect FB authentication prior to submitting form and after validation.      

</script>

【问题讨论】:

  • 不确定是否是问题的原因,但您的 HTML 无效。头部有一个&lt;div&gt;,应该在正文部分,似乎完全丢失了。

标签: internet-explorer-8 facebook


【解决方案1】:

我不认为你的代码是完整的,但我会试一试。 首先,IE8 可能有问题,尝试包装 FBRoutine();调用 document.onload ow window.onload。 另请阅读How to detect when facebook's FB.init is complete,可能在您调用 FB.getLoginStatus 时 JS SDK 尚未初始化。

请检查您是否已发布完整代码,祝您好运

【讨论】:

    【解决方案2】:

    根据 FB 文档:

    “将 XML 命名空间添加到文档的标记中。这是 XFBML 在早期版本的 Internet Explorer 中工作所必需的。”

    <html xmlns:fb="http://ogp.me/ns/fb#">
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-02-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-22
      相关资源
      最近更新 更多