fbjs

Facebook Session Transfer js-SDK to php-SDK

北慕城南 提交于 2020-01-03 04:59:19
问题 I am using PHP SDK 2.1.2 and using the standard http://connect.facebook.net/en_US/all.js as the JS SDK. This is what i want to achieve: 1) Initialize JS Sdk, Call Fb.UI with (email,user_location,user_birthday), method: 'oauth', in response, if the user successfully gives permission do an ajax call to the server and then use PHP-SDK to do a call to Graph API and get the required data. (Well, you might argue to do a call to graph API via JS SDK but the current scenario requires me to use PHP

Facebook quote application error

假如想象 提交于 2019-12-24 10:45:05
问题 How do I code a Facebook quote application taking its data from PHP/MySQL page generating quotes randomly? I've already developed one, but it's using jQuery which FBML doesn't support and since I'd like the profile tab I'd rather go for FBML instead of iframe. How to do this without jQuery or using FBJS? <!DOCTYPE html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link rel="stylesheet" type="text/css" href="css/jquote.css" /> <!--<script type="text/javascript"

FB.getLoginStatus not calling its callback

帅比萌擦擦* 提交于 2019-12-21 07:07:18
问题 The title really says it all. Under some (undetermined) conditions FB.getLoginStatus() just stops working and won't invoke the callback I gave it. The only interesting clues I've found are FB.Auth._loadState is stuck on "loading" -- whatever is supposed to make it click over to "loaded" isn't happening slight delays like putting in alert() calls tend to make it start working Any hints at all about even how to investigate this welcome. 回答1: This usually happens for me when I am running the

how to check special permissions in facebook

与世无争的帅哥 提交于 2019-12-19 05:32:11
问题 how can i check in javascript if user has granted my site the publish stream permission ? 回答1: I had this same problem but couldn't find any sample code. Anyways, I came up with this, which works for me. Hope this helps someone. FB.api('/me/permissions', function (response) { var perms = response.data[0]; if (perms.publish_stream) { // User has permission } else { // User DOESN'T have permission } } ); 回答2: The API method you're looking for is Users.hasAppPermission . You could call it

How to download xml file through in php?

邮差的信 提交于 2019-12-13 07:58:58
问题 I created xml file in php. This file is successfully saved in my server directory. Now, I want to download this file only through php, not javascript. How can I save this file? 回答1: Try file_get_contents() and file_put_contents() . <?PHP $xml = file_get_contents("http://yoursite.com/yourxml.xml"); // your file is in the string "$xml" now. file_put_contents("/path/to/file/yourxml.xml", $xml); // now your xml file is saved. ?> 来源: https://stackoverflow.com/questions/5154781/how-to-download-xml

How can I detect that a user signed into Facebook?

一曲冷凌霜 提交于 2019-12-08 03:10:10
问题 Here is my scenario. When a user opens a browser and goes to facebook.com to sign himself in, I want to be able to detect that and init my Facebook application sign-in process. Is that possible? I'm asking because I noticed that signing into Facebook itself doesn't get my app signed in automatically, which is not good. I'd prefer JavaScript client code. 回答1: UPDATE: Here you have a FULLY WORKING example. The only thing you will need to do is to replace the APP_ID for whatever ID you get when

How can I detect that a user signed into Facebook?

拥有回忆 提交于 2019-12-06 12:27:51
Here is my scenario. When a user opens a browser and goes to facebook.com to sign himself in, I want to be able to detect that and init my Facebook application sign-in process. Is that possible? I'm asking because I noticed that signing into Facebook itself doesn't get my app signed in automatically, which is not good. I'd prefer JavaScript client code. UPDATE: Here you have a FULLY WORKING example. The only thing you will need to do is to replace the APP_ID for whatever ID you get when sign your app at: http://www.facebook.com/developers/ and the port you may use for the localhost test. This

Why does my setTimeout speed up when I have multiple tabs open to my site?

萝らか妹 提交于 2019-12-06 01:38:58
问题 I have a timer that counts down every second. It works great until the user opens up 3 or 4 tabs of the my site, at which point the newest tab's timer goes double or triple speed. I can currently only reproduce the bug in IE8. I was previously using setInterval, and could reproduce the bug in Firefox as well. I'm actually using FBJS (Facebook's Javascript), so I'll just give some pseudocode. function countDown() { ... setTimeout(function() { countDown() }, 1000); } countDown(); However, what

Why does my setTimeout speed up when I have multiple tabs open to my site?

被刻印的时光 ゝ 提交于 2019-12-04 05:25:00
I have a timer that counts down every second. It works great until the user opens up 3 or 4 tabs of the my site, at which point the newest tab's timer goes double or triple speed. I can currently only reproduce the bug in IE8. I was previously using setInterval, and could reproduce the bug in Firefox as well. I'm actually using FBJS (Facebook's Javascript), so I'll just give some pseudocode. function countDown() { ... setTimeout(function() { countDown() }, 1000); } countDown(); However, what I'm really looking for is more theoretical. I know browsers can try and play "catch up" with

FB.ui feed not giving a callback

天大地大妈咪最大 提交于 2019-12-04 03:37:22
问题 I am unable to get any feedback from my Facebook FB.UI() method. I am convinced that I am using it correctly, as the actual post does post to my wall, but the callback data is either missing or empty. I am using: FB.ui({ method: 'feed', name: 'asd', link: 'asd', picture: '', description: 'asd' }, function(response) { console.log(response); if(response.post_id) { $.post("ajax/wall.php",{wall : 1}); } else { } } ); 回答1: I am not sure how this resolved itself, but it did :) I cleared my cache