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 6847851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:47:43+00:00 2026-05-27T00:47:43+00:00

I have the following javascript: function graphStreamPublish(){ FB.api(‘/me/feed’, ‘post’, { message : 1, link

  • 0

I have the following javascript:

function graphStreamPublish(){
    FB.api('/me/feed', 'post', 
    {
        message     : "1",
        link        : "2",
        picture     : "3",
        name        : "4",
        description : "5"
    }, 
    function(response) {        
        if (!response || response.error){
            alert('Error occured');
        }else{
            var x = fqlQuery();
            console.log(x);
            alert('Post ID: ' + response.id);
        }
    });
}

function fqlQuery(){
    FB.api('/me', function(response) {
        var query = FB.Data.query('select name, profile_url from user where uid={0}', response.id);
        query.wait(function(rows) {
            var x=rows[0].name;
            var y=rows[0].profile_url;
            return [x, y]; 
         });
    });
}

which is based on the code from:

http://thinkdiff.net/facebook/new-javascript-sdk-oauth-2-0-based-fbconnect-tutorial/

The problem is that when the function graphStreamPublish() is run this in turn also executes fqlQuery, now the returned values in graphStreamPublish shows up in the console as undefined. Please can anyone help me in getting the values from fqlQuery back into graphStreamPublish.

Please note that when I console.log(rows) in the function fqlQuery there is definitely values that are being returned from FB.

Thanks

  • 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-27T00:47:44+00:00Added an answer on May 27, 2026 at 12:47 am

    You can’t do it this way around. You are doing:

    var x = fqlQuery();
    

    but fqlQuery isn’t returning anything. Your return statement is in the callback, which is a completely different method:

    function(rows) {
       var x=rows[0].name;
       var y=rows[0].profile_url;
       return [x, y]; 
    }
    

    That is why your method return is undefined. Time will pass between fqlQuery() being called, and the callback being called. You will have to do the processing you need inside the callback of fqlQuery

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following JavaScript code: Link In which the function makewindows does not
I have the following javascript function: <script type=text/javascript> function quickCardRegister_OnCompleteSave() { publishContent('This is a
I have the following Javascript code add_num = { f: function(html, num) { alert(this.page);
I have the following javascript: $('#ge-display').click(function (event) { window.open('/googleearth/ge-display.php','','scrollbars=yes,menubar=no,height=650,width=1000,resizable=yes,toolbar=yes,location=no,status=no'); event.stopPropagation(); return false; }); the
I have the following javascript code, which loads without error, however the update function
So I have the following JavaScript code: <script type=text/javascript> function clearRadioButtons() { document.getElementById(radiobutton1).checked=; //etc
I have Designed the Javascript function My.js it contains following code My.js function display(){
I have the following function. <script type=text/javascript> window.onbeforeprint = expandAll; function expandAll(){ $(.fieldset:gt(0)).slideDown(fast); }
I have the following jquery function > <script type=text/javascript> > > $(document).ready(function() { >
I have the following code: <script type=text/javascript> function SubmitForm() { form1.submit(); } function ShowResponse()

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.