Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 494399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:29:35+00:00 2026-05-13T05:29:35+00:00

i am starting to build a facebook extension app. i got the api auth

  • 0

i am starting to build a facebook extension app. i got the api auth part working.
now as i request anything using the javascript api, i am unable to.

for example:

<div id="profile_pics"></div>
<script type="text/javascript">
var widget_div = document.getElementById("profile_pics");
FB.ensureInit(function () {
  FB.Facebook.get_sessionState().waitUntilReady(function() {
  FB.Facebook.apiClient.friends_get(null, function(result) {
    var markup = "";
    var num_friends = result ? Math.min(5, result.length) : 0;
    if (num_friends > 0) {
      for (var i=0; i<num_friends; i++) {
        markup += 
          '<fb:profile-pic size="square" uid="'+result[i]+'" facebook-logo="true"></fb:profile-pic>';
      }
    }
    widget_div.innerHTML = markup;
    FB.XFBML.Host.parseDomElement(widget_div);
  });
  });
});
</script>

the above sample code should display square thumbnail images of my friends. it just shows square thumbs (BLANKS) with the facebook logo over it. where am i going wrong?

FYI:
i have the files located in the localhost. in the facebook application settings, i gave the connect url as the address of the ‘localhost/dir/index.html’ url. is there something i am doing wrong?
please help me out.

EDIT
this the code i am using to make login:

<script type="text/javascript"> 
//<![CDATA[ 
var api_key = 'myapikey'; 
var channel_path = '/xd_receiver.htm'; 
FB_RequireFeatures(["Api"], 
function(){ 
    // Create an ApiClient object, passing app's API key and 
    // a site relative URL to xd_receiver.htm 
    FB.Facebook.init(api_key, channel_path); 
    var api = FB.Facebook.apiClient; // require user to login 
    api.requireLogin(function(exception)
    { 
        FB.FBDebug.logLevel=1; 
        FB.FBDebug.dump("Current user id is " + api.get_session().uid); 
        // Get friends list 

        //5-14-09: this code below is broken, correct code follows //
        //api.friends_get(null, function(result){ 
            // Debug.dump(result, 'friendsResult from non-batch execution '); 
            // }); 

        api.friends_get(new Array(), function(result, exception){ 
            FB.FBDebug.dump(result, 'friendsResult from non-batch execution '); 
            }); 
        }); 
    }); 
//]]> 
  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T05:29:35+00:00Added an answer on May 13, 2026 at 5:29 am

    The sample code you posted works fine… I just tested it in one of my devel FB apps and it created profile pictures of my friends.

    You might want to throw a console.log(result) into your code and examine the results of the API call with Firebug. Perhaps it will have an error message for you. It sounds to me like there could be an issue here, because an fb:profile-pic created without a valid uid would show a blank square.

    I would double-check that the URL you gave the application under the “Connect URL” setting is a valid URL that Facebook can reach. Also double-check that the path you gave for the xd_reciever.htm file is working. A third thing worth double-checking is that you have the correct xml namespace set on your document:

    <html xmlns:fb="http://www.facebook.com/2008/fbml" xml:lang="en" lang="en">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I build a Firefox Extension and i'm using the graph api. At the moment
I'm starting a build of a Drupal based online store, using Ubercart etc. It
I am starting to build my first Android app. I have reached the point
i'm starting to build a part of a system which will hold a lot
My build agent working directories are starting to take too much space on the
we're starting to build a web app. My colleague is developing on linux, and
I am just starting to build a new Meteor app. The only thing I
I created a Facebook app mostly built in jQuery. I need to now check
I'm starting to build an iOS app which will use Twitter as the means
Im starting to build a new app and I would like to use Backbone

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.