xfbml

Facebook XFBML after login, get user information through JavaScript

牧云@^-^@ 提交于 2019-12-04 19:47:19
I use the XFBML Facebook login button to authenticate the user. After users entered correct password. How do I use FB.Facebook.apiClient or any related JavaScript to get user logined information? you need to init this function at begining. like this: FB.init("APIKEY","/xd_receiver.htm", {"reloadIfSessionStateChanged": true,"ifUserConnected":onFBConnected}); function onFBConnected(){ var api = FB.Facebook.apiClient; var uid = [api.get_session().uid]; var fields = ["name"]; api.users_getInfo(uid, fields, function(result){ alert(result[0].name); }); } solved my problem I hope it helps. 来源: https:

Detect Like with Facebook JavaScript API + iFrame

放肆的年华 提交于 2019-12-04 13:30:50
Building an app with the Facebook JavaScript API that will embedded into a page using the new iframe method. I want to detect if they have liked the current page. Usually I would use print_r($_REQUEST) in PHP but that doesn't seem to work when using an iframe. There is also this option: http://developers.facebook.com/docs/reference/fbml/visible-to-connection/ but it says its deprecated and I have never liked this method as its fairly hacky. What is the way t do it now? Prefer to use XFBML + JavaScript API but can use PHP if required. We've done this several times, and it seems to work pretty

Inserting fb:comments with javascript

霸气de小男生 提交于 2019-12-04 11:15:54
How do I insert the facebook comment plugin using javascript? My website is ajax-driven and I need to load/reload the facebook comment plugin depending on a hash (index.html/#frontpage) -> (index.html/#movie1). My first thought was to use innerHTML: document.getElementById('facebook').innerHTML = "<div id='fb-root'></div><fb:comments href='http://viljegse.dk/' num_posts='10' width='572'></fb:comments></div>"; This however doesn't work, so I tried creating the elements and then appending them, but then there is the <fb:comments> element, which is a problem. Best regards, Ulrik FB:Root should be

FB.Event.subscribe not firing for certain events

*爱你&永不变心* 提交于 2019-12-04 10:23:16
So I'm trying to do some event handling when a user clicks the like button. My Facebook button is being created asynchronously via: (function() { var e = document.createElement('script'); e.async = true; e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; document.getElementById('fb-root').appendChild(e); }()); And that works great. I have the following function running as well: window.fbAsyncInit = function() { FB.init({status: true, cookie: true, xfbml: true}); FB.Event.subscribe("xfbml.render", function() { console.log('xfbml.render'); FB.Event.subscribe("edge.create

Facebook XFBML is not rendering in Internet Explorer 8

♀尐吖头ヾ 提交于 2019-12-04 05:03:22
I put up this test page to illustrate this issue: (dead Link) Every browser I've tested on has worked but in Internet Explorer 8. The odd part is that Internet Explorer 8 doesn't even report an error, WOW, and that is something. So right now I'm stuck with to nothing to work on or debug. What have I overlooked? So somehow the xmlns attribute that I had previously set to the HTML tag was gone, probably me undoing things like crazy. Here is how it should be if anyone encounters this issue: <html xmlns:fb="http://www.facebook.com/2008/fbml"> <html xmlns:fb="http://ogp.me/ns/fb#"> <head></head>

Facebook Login/Like Fail on IE8

十年热恋 提交于 2019-12-03 13:57:39
I've recently implemented Facebook Login button and a Facebook "Like" button using XFBML. You can see the site on http://colnect.com Everything works well with FireFox, Chrome, Opera & Safari. However, IE doesn't show neither "login" or "like" buttons and no error message is available as well. Any ideas? Seems I'll be the kind of person to answer himself hoping it'll help someone. For Internet Explorer to recognize Facebook you should add xmlns:fb="http://www.facebook.com/2008/fbml" to your html tag, for me it's <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008

Post comment with facebook like button doesn't work

社会主义新天地 提交于 2019-12-03 13:56:47
Im tryng to use the XFBML implementation of the Like Button, as it is described in the facebook social plugin page The like button appears and works fine (it asks for a confirm action, but it works ok). When i press the like button, a new dialog comment box popups that lets me add some comment to appear to my wall. However, when i press the "post to facebook" button, nothing happens and the popup dialog remains there. Finally, the comment doesn't appear to my facebook wall. Any help?? 来源: https://stackoverflow.com/questions/13494947/post-comment-with-facebook-like-button-doesnt-work

Fan-Gate, Like-Gate, show-to-connections, with javascript and like box?

感情迁移 提交于 2019-12-03 10:14:47
问题 I have a facebook likebox on my site (not an iframe app) where I need to create gated content. I understand the FB.Event.subscribe using edge.create and edge.remove but what I really need is to know if a user already likes the page not simply if they became a fan or stopped being a fan. Is there anything I can see as a callback maybe from the xfbml.render? I am limited (by my company) to using front end languages, meaning javascript is really my only option at this point. I would gladly use

How do I remove a facebook comment warning?

微笑、不失礼 提交于 2019-12-01 22:51:14
my fb comments code is: <fb:comments url="<?=$this_url?>" width="600" xid="<?=$this_unique_xid?>" notify="true" candelete="true" simple="1" numposts=1 url="http://www.veethi.com"></fb:comments> Now if i want to remove the warning message: Warning: this comments plugin is operating in compatibility mode, but has no posts yet. Consider specifying an explicit ‘href’ as suggested in the comments plugin documentation to take advantage of all plugin features I need to replace "url" to "href", but by doing this i lose my old comments, Is anyone who facing the problem or solution pls, reply me. I need

Will xid-based fb:comments be lost on June 1st?

无人久伴 提交于 2019-12-01 14:17:21
As far as I know there is no way to migrate existing Facebook comments which use fb:comments/xid over to the new fb:comments/href version. There are some StackOverflow topics ( How to migrate Facebook comments from using "URL" property to "HREF" , http://facebook.stackoverflow.com/q/8487357/138526 ) which supports this interpretation. Now Facebook says in their FBML documentation : Starting June 1, 2012 FBML apps will no longer work as all FBML endpoints will be removed According to the docs 'xid' is FBML, not XFBML. Does that mean all old comments will be gone forever? I got an official