1

难住了。

http://www.mixerman.net

我在 index.php 上有一个模态窗口,如果不存在 cookie 会显示,(当然我在 chrome 中进行开发,所以我可以在最后找到坏消息,哈哈),它在那里工作得很好,但是facebook的“like”代码根本不显示在ie或firefox中。它不是div(我可以在那里抛出静态文本并显示出来,只是fb、html5、xfbml、iframe中没有任何东西,甚至只是添加某事的网址..)

有人有想法么?

我当然很感激!

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns:fb="http://ogp.me/ns/fb#">
<head>
<title>The Daily Adventures Of Mixerman | Welcome</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--

function createCookie(name,value,days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime()+(days*24*60*60*1000));
        var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
}

function eraseCookie(name) {
    createCookie(name,"",-1);
}


</script>
<link href="styles/mixerman.css" rel="stylesheet" type="text/css">

<body>
<div id="fb-root"></div>
<script>(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_GB/all.js#xfbml=1&appId=265199713527696";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>


<div id="fade">
  <div id="overlay">
    <div id="offame" onClick="document.getElementById('overlay').style.display='none';document.getElementById('fade').style.display='none'"></div>
    <div id="facebookery">
      <fb:like href="http://www.facebook.com/pages/Mixerman/8900341182" send="false" width="250" height="35" show_faces="false" font="arial"></fb:like>
    </div>
  </div>
</div>

<script>
var days = 30;
var advert = document.getElementById('fade');document.getElementById('facebookery');
if (readCookie('mixermanadvert')) {
    advert.className = '';
} else {
    advert.className = 'show';
    createCookie('mixermanadvert', 'yes', days);
}
</script>
</body>
</html>

css的相关部分是:

#overlay {
    display: block;
    position: absolute;
    left: 25%;
    top: 25%;
    width: 656px;
    height: 380px;
    z-index: 100;
    background-image: url(../images/tendollarbook.png);
    background-repeat: no-repeat;
    background-position: center center;
}
#offame {
    position: absolute;
    display: block;
    left: 571px;
    top: 42px;
    width: 55px;
    height: 55px;
    cursor: pointer;
    }

#fade {
    display: none;
    position: absolute;
    left: 0%;
    top: 0%;
    background-color: black;
    -moz-opacity: 0.8;
    opacity: .80;
    filter: alpha(opacity=80);
    width: 100%;
    height: 100%;
    z-index: 90;
}
#fade.show {
    display: block;
}
#facebookery {
    position: absolute;
    left: 416px;
    top: 202px;
    width: 240px;
    z-index: 150;
    opacity: 1.0;
    filter:alpha(opacity=100);
    }

浏览器是:

Chrome 版本 30.0.1599.69 m - 有效!Firefox 24(大声笑!) - 没用!Internet Exploder 10 - 不,那里也没有工作...... Safari - 工作!

..所有在 Windows 7 Pro 和最新的 Apple OS 上..

客户可以跳过 FB 的“Like”部分而只是链接到 FB,但在这一点上,这让我非常疯狂,我需要在这里知道答案。

YMMV..

4

0 回答 0