Facebook喜欢在Firefox中不可点击的按钮iframe实现,可以在其他浏览器中工作

Facebook like button iframe implementation not clickable in Firefox, works in other browsers

本文关键字:实现 工作 iframe 其他 浏览器 Firefox 喜欢 Facebook 按钮      更新时间:2023-09-26

我使用的是普通的iframe代码,而不是xfbml(正在附加片段,因此恢复为基本的iframe)。

<iframe scrolling="no" frameborder="0" style="border: medium none; overflow: hidden; width: 92px; height: 22px; position:absolute;top:3px;left:180px;" allowtransparency="true" src="http://www.facebook.com/plugins/like.php?href=http://www.xxxxwebsitexxxx.co.uk&amp;layout=button_count&amp;show_faces=false&amp;width=92&amp;action=like&amp;font=arial&amp;colorscheme=light"></iframe>

该按钮显示正确,但在Firefox中单击它时,我收到以下错误:

this.event is undefined
http://static.ak.fbcdn.net/rsrc.php/v1/yW/r/MrPDat_Xp7Z.js (line 31)

我认为冒犯的台词是这样的:

__d("DOMEvent",["copyProperties"],function(a,b,c,d,e,f){var g=b("copyProperties");function h(i){this.event=i||window.event;this.target=this.event.target||this.event.srcElement;}g(h.prototype,{preventDefault:function(){var i=this.event;i.preventDefault?i.preventDefault():i.returnValue=false;return this;},stopPropagation:function(){var i=this.event;i.stopPropagation?i.stopPropagation():i.cancelBubble=true;return this;},kill:function(){this.stopPropagation().preventDefault();return this;}});e.exports=h;});

__d("DOMEventListener",[],function(a,b,c,d,e,f){var g,h;if(window.addEventListener){g=function(j,k,l){j.addEventListener(k,l,false);};h=function(j,k,l){j.removeEventListener(k,l,false);};}else if(window.attachEvent){g=function(j,k,l){j.attachEvent('on'+k,l);};h=function(j,k,l){j.detachEvent('on'+k,l);};}var i={add:function(j,k,l){g(j,k,l);return {remove:function(){h(j,k,l);j=null;}};},remove:h};e.exports=i;});

这是一个已知问题吗,我已经在普通网站中尝试了相同的代码,并禁用了所有附加组件以确保它不是兼容性问题。

我在Mac上使用Firefox 12.0。

我遇到了同样的问题,但我没有做任何修改,所以我认为这是Facebook的错,因为这非常简单(只需从FB复制并粘贴到您的网站中),并且可以在IE,Chrome和Safari中工作(到目前为止我已经尝试过)但是,如果您已经登录FB,则没有这样的问题。让我们尝试联系FB让他们知道。

截至2012年5月3日22:14(GMT+1),Facebook似乎已经修复了这个问题。

我检查了 iframe 实现拉入的 javascript,并且有问题的代码行已更改。

当我现在单击Facebook喜欢按钮时,弹出窗口会按原样显示。

我只能说,当我第一次登录Facebook时,我在Firefox中没有这个问题,所以在尝试从Facebook加载登录弹出窗口时一定出了什么问题?我敢打赌Facebook很快就会解决这个问题,因为它只会影响任何使用iframe版本的喜欢按钮的网站。

编辑:这个问题似乎由Facebook解决,但截至今天,问题又回来了。也许Facebook已经改变了其他东西,导致这个问题再次发生?