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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:52:25+00:00 2026-05-25T20:52:25+00:00

My javascript solution for pulling in the likes for a set of links on

  • 0

My javascript solution for pulling in the likes for a set of links on a certain page is no longer working. I can’t find anything wrong, and I’ve tried using the .api() method (below) and the Data.query() method but neither is working. This is the code that I currently have and it’s similar to what I was using when it was working.

var inlist = [url1, url2, url3..... urln];

FB.api(
  {
    method: 'fql.query',
    query: 'SELECT url, total_count FROM link_stat WHERE url IN('+inlist.substr(0, inlist.length-2)+')'
  },
  function(response) {
    console.log(response);
    for( var i = 0 ; i < response.length ; i++ ) {
      if (response[i]['total_count'] > 0){
        $(vids[response[i]['url']]).append("<div class='likes'>"+response[i]['total_count']+"</div>");
      }
    }
  }
);

The console reports nothing, my FB object is initialized correctly (the example queries run with no problem), and the URL’s are generated dynamically based on a list of links. Also, it’s worth mentioning that I tested the FQL here:http://developers.facebook.com/docs/reference/rest/fql.query/ and it worked fine…

  • 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-25T20:52:26+00:00Added an answer on May 25, 2026 at 8:52 pm

    Looks like the problem was that I was including too many IN(…) items. Oddly enough though there was no error, just no response. I limited the items in to 10 and everything started working again.

    for(var i=0 ; i < Math.ceil(inlist.length/10); i++) {
      FB.api(
        {
          method: 'fql.query',
          query: 'SELECT url, total_count FROM link_stat WHERE url IN('+inlist.slice((10*i), ((i+1)*10)).join(', ')+')'
        },
        function(response){
          for( var i = 0 ; i < response.length ; i++ ) {
            ...
          }
        }
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone please help me out with a JavaScript/jQuery solution for this arithmetic problem:
I've been pulling my hair out with this one, although I'm certain the solution
I'm looking for a javascript solution to find all jQuery scripts on a html
I've searched a good deal, and can't seem to find a satisfactory solution. I
Does anybody know, off the top of your heads, a Javascript solution for calculating
I was wondering whenever exists a solution to perform synchronization in JavaScript code. For
I'm trying to implement chained filter dropdown using just javascript - jquery. The solution
Javascript: The Good Parts is a great book. Often I find myself reading passages
Using ASP.NET to generate several checkboxes. Looking for a JavaScript solution that will test
I am looking for a solution where I can mark couple of hotspot area

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.