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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:16:17+00:00 2026-05-29T07:16:17+00:00

I have been looking around for a jQuery json method to pull in stats

  • 0

I have been looking around for a jQuery json method to pull in stats for a given facebook, for a project that I am starting in uni. I found this had already been asked here: trying to pull the number of likes from a facebook fanpage using JSONP and JQuery

Having used the code for my page, it works great, and is lightweight, however I am now wanting to use this code to pull in the results from multiple pages, but have tried to find a solution and hit a brick wall.

My current code, pulling in one page’s data is:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script type="text/javascript">
      $(function() {
        //Set Url of JSON data from the facebook graph api. make sure callback is set   with a '?' to overcome the cross domain problems with JSON
        var url = "https://graph.facebook.com/immbudden?callback=?";

        //Use jQuery getJSON method to fetch the data from the url and then create our unordered list with the relevant data.
        $.getJSON(url,function(json){
            var html = "<ul><li>" + json.likes + "</li><li>" + json.about + "</li></ul>";
            //A little animation once fetched
            $('.facebookfeed').animate({opacity:0}, 500, function(){
                $('.facebookfeed').html(html);
            });
            $('.facebookfeed').animate({opacity:1}, 500);
        });
      });
    </script>
    <link rel="stylesheet" href="style.css" media="all">
</head>

<body>
    <div id="wrapper"><!--wrapper open-->
        <div class="facebookfeed">
        <h2>Loading...</h2>
    </div>
    </div><!--wrapper closed-->
</body>

I am literally just starting to properly delve into jQuery, so any help at all is greatly appreciated!

Thanks in advance, Michael

  • 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-29T07:16:17+00:00Added an answer on May 29, 2026 at 7:16 am

    You can batch request the Facebook API so you don’t even need to make multiple calls for multiple pages 🙂

    The batch request looks something like this: https://graph.facebook.com/?ids=id1,id2,id3 etc. You would then need to loop through the results to print them out. So the entire change would look like so:

    var url = "https://graph.facebook.com/?ids=immbudden,page2,page3&callback=?";
    
    $.getJSON(url, function(json) {
        var html = '';
    
        $.each(json, function(index, item) {
            html += "<ul><li>" + item.likes + "</li><li>" + item.about + "</li></ul>";
        });
    
        //A little animation once fetched
        $('.facebookfeed').animate({
            opacity: 0
        }, 500, function() {
            $('.facebookfeed').html(html);
        });
        $('.facebookfeed').animate({
            opacity: 1
        }, 500);
    });
    

    I’ve created a working jsFiddle for you here: http://jsfiddle.net/rYyzf/

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

Sidebar

Related Questions

I've been looking around for quite a while and feel that I have a
Can't get my head around this Jquery problem I have.. I've been looking around
I have been looking around for examples related to converting JSON strings to Java
I have been looking around for a solution for this problem that works across
I have been looking around for solutions, and tried to implement what is often
I have been looking around ocn Google and Stackoverflow but haven't found what I
I have been looking around on the web and found some articles about the
I have been looking around and even found a couple of related answers and
So I am a little confused, I have been looking around trying to determine
Have been looking at the MVC storefront and see that IQueryable is returned from

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.