使用 WooBox 我为页面创建了一个自定义选项卡。此自定义选项卡使用 iFrame 在我的服务器上显示 PHP 文件。发生的是,这个 PHP 有一个 Facebook 分享和一个 Facebook 邀请按钮,在 Firefox 上工作但在 Internet Explorer 上不起作用:
PHP 文件相当简单,我在此处发布相关位:
<?php header("p3p: CP=\"ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV HONK\"");?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns:fb="https://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/">
然后是带有 2 个元标记、标题和样式标记的 HEAD 标记,然后:
<script>
function fb_share(){
FB.ui({
method: 'feed',
name: 'Jardim Botânico UTAD',
caption: '',
link: 'http://facebook.com/utadjb',
picture: 'http://jb.utad.pt/img/site/logotipo200200.png',
description: 'Acabei de ver a página do facebook do Jardim Botânico UTAD!'
},
function(response){
if(response){
alert('Post was published.');
}else{
alert('Post was not published.');
}
});
}
function fb_invite(){
FB.ui({
method: 'apprequests',
message: 'Acabei de ver a página do facebook do Jardim Botânico UTAD em http://facebook.com/utadjb! Vê também!'
},
function(response){
if (response){
alert('Post was published.');
}else{
alert('Post was not published.');
}
});
}
</script>
这里面是按钮的调用方式:
<div id="share_posttowall" class="shareoption"><span>Partilhe no seu mural</span><a onclick="fb_share(); return false;" class="fbbluebutton" href="#">Partilhar</a></div>
<div id="share_sendinvite" class="shareoption"><span>Convide os seus amigos</span><a onclick="fb_invite(); return false;" class="fbbluebutton" href="#">Convidar</a></div>
有人知道为什么这两个按钮在 Internet Explorer 上不起作用吗?我已经用尽了所有可能的故障排除...