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

  • Home
  • SEARCH
  • 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
  • 0 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

Ask A Question

Stats

  • Questions 281k
  • Answers 281k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Subclipse has different update sites for the 1.4 and 1.6… May 13, 2026 at 3:52 pm
  • Editorial Team
    Editorial Team added an answer This works on Linux: $ perl -MPOSIX -e 'print POSIX::strftime("%Y-%m-%dT%H:%M:%S%z\n",… May 13, 2026 at 3:52 pm
  • Editorial Team
    Editorial Team added an answer Yes, just pass your query string parameters in to contact_path:… May 13, 2026 at 3:52 pm

Related Questions

I am starting to build a new web application that will require user accounts.
As a little side project, I am starting to build a new website for
I am starting to I am learning scala, and trying to build some simple
I haven't been around Java development for 8 years, but am starting to build

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.