简体   繁体   中英

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

I'm using the plain iframe codes, NOT xfbml (was getting fragments appended so reverted to basic 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>

The button displays correctly but upon clicking it in firefox, i get the following error:

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

I think the offending line is this:

__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;});

Is this a known issue, i've tried the same code in a plain website as well as disabling all add-ons to make sure it's not compatability problems.

I'm using firefox 12.0 on a mac.

I'm facing same issue but I have not done any mods so I think it's facebook fault as this is very straightforward (just copy from FB and paste in your site) and it works in IE, Chrome and Safari (So far I've tried) But there's no such issue if you are already logged in FB. Let's try to contact FB to let them know.

All I can say is that I don't have this issue in Firefox when I logged on Facebook first, so something must go wrong when trying to load the login popup from facebook? I bet Facebook will resolve this issue soon, since it affects simply any website using the iframe version of the like button.

Edit: The problem seemed to be fixed by Facebook, but as of today the problem is back. Perhaps Facebook has changed something else back which caused this problem to occur again?

As of May 3rd 2012, 22:14 (GMT+1) it appears this problems has been fixed by Facebook.

I checked the javascript the iframe implementation pulls in and the offending line of code has been changed.

When I now click on the facebook like button, the popup displays as it should.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM