facebook-javascript-sdk

FB init function gives wrong version error

大兔子大兔子 提交于 2019-11-27 05:41:31
问题 I'm using the Facebook JS sdk, and I have created a new App today. Everything is configured properly. Using init function like: window.fbAsyncInit = function() { FB.init({ appId : 'xxxx', // App ID status : false, version: 'v2.0', cookie : true, xfbml : false // parse XFBML }); }; (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/pl_PL/sdk.js"; fjs.parentNode.insertBefore

Facebook JS SDK FB.logout() doesn't terminate user session

被刻印的时光 ゝ 提交于 2019-11-27 04:29:46
问题 I'm attempting to log a user out of facebook with the Facebook JS SDK, however calling: FB.logout(function(response){ console.log(response); }); returns: response.status == "connected" And only after refreshing the page does the SDK realize that the session has ended. Anyone know what could be causing this behavior? This code previously worked in my application and has recently started behaving this way. Another example using FireBug: 回答1: https://developers.facebook.com/bugs/245362365535898

Facebook Javascript SDK window location reload not working on Firefox

独自空忆成欢 提交于 2019-11-27 03:40:28
问题 I'm building a website with Facebook Connect and therefore using the Facebook Javascript SDK. Problem: when using Firefox, the page doesn't reload properly once logged in or logged out. FB.Event.subscribe( '{% if current_user %}auth.logout{% else %}auth.login{% endif %}', function(response){ window.location.reload(); }); Obviously, it looks like a known problem (just type "window location reload not working on firefox" and you'll get a lot of results) More precisely, Firefox doesn't seem to

Given URL is not allowed by the Application configuration

蓝咒 提交于 2019-11-27 03:15:26
问题 I am trying to use the Facebook javascript sdk for my chrome extension. Since it is a chrome extension how do i integrate it with facebook? is it an app on facebook.com or a website? Currently i have it as a website. my site url on the settings is: http://localhost/Users/home/Documents/facebook/ i have also enabled web sharing on my mac. do i need to set the site domain as well? what am i doing wrong here? 回答1: Enter http://localhost/Users/home/Documents/facebook/ as your "Site Domain" on the

How to force Facebook JS-SDK to render dynamically added widgets?

五迷三道 提交于 2019-11-27 02:46:29
问题 The content within the app is being updated using XHR. This involves changing the URL of the comment box: <div class="fb-comments" data-href="http://example.com?id=[dynamic]" data-num-posts="2" data-width="470"></div> Upon creating a new Facebook widget placeholder after the page been fully loaded, how do I request Facebook JS SDK to render new elements on the page? 回答1: Call the JavaScript SDK's FB.XFBML.parse(); function after you dynamically insert the fb-comments div. See: http:/

What am I doing wrong in localhost Facebook app development?

让人想犯罪 __ 提交于 2019-11-27 02:27:23
问题 App Domains: localhost Website with Facebook login: http://localhost/auth I go to http://localhost/auth/ and in my Chrome developer console I see the error: Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains. I do a view-source to see the following: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

Redirect from Facebook canvas page to website

落花浮王杯 提交于 2019-11-27 02:23:04
问题 Is there a way to redirect from my Facebook canvas page to my external website? I've seen blogs and stackoverflow answers of the form: <script> window.top.location = 'http://www.yoursite.com/'; </script> Unfortunately these kinds of solutions never work. I've tried top.location.href, window.location and location.href as well.. nothing works. Did Facebook remove the possibility to redirect from javascript by parsing out this kind of code? Is there a way to still redirect? UPDATE : What happens

how to get email id of Facebook user using javascript sdk

有些话、适合烂在心里 提交于 2019-11-27 00:42:56
问题 I am using JavaScript API to create my app for Facebook. The problem is, it's returning email = undefined . I don't know why? And if I use Facebook login/logout button on my app then the alert shows correct email id of the user but I don't want to do that. What am I missing? Here is my code: <p><fb:login-button autologoutlink="true" perms="user_about_me,email"></fb:login-button></p> <script> window.fbAsyncInit = function () { FB.init({ appId: '250180631699888', status: true, cookie: true,

How to programatically create a Facebook application via JS SDK or Open Graph API? (createApplication)

和自甴很熟 提交于 2019-11-26 23:24:23
问题 I know there are currently two methods that can be used to do this, documented (poorly) on Facebook's Developer site: The old (depreciated) JavaScript SDK FB.Connect.createApplication A new FBJS method Facebook.createApplication (only for use on Canvas pages) The problem is that I not using a Canvas app that runs FBJS, and I am not using the OLD JS SKD. I am trying to do this on a regular old PHP website that uses the current JavaScript SDK and the PHP SDK. I am doing the usual Open Graph API

Facebook like and share button with callback

空扰寡人 提交于 2019-11-26 22:37:32
问题 I have a webpage where I have placed a Facebook like & share button and corresponding javascript callback functions are also present. Now the problem is, the javascript callback fires only when the user 'likes' and doesn't seem to fire when the 'share' button is pressed. Its like I need to award the user everytime he/she shares the link. Whereas with 'like', a user can only like a link once (not considering unlike/re-like). I know that the Share button is deprecated. But facebook now provides