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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:07:39+00:00 2026-05-12T05:07:39+00:00

$.getJSON(‘http://twitter.com/followers/ids.json?screen_name=/…’+ query1 + ‘&callback=?’, function(data) { alert(‘JSON data string 1 is: ‘+data); $.getJSON(‘http://twitter.com/followers/ids.json?screen_name=/…’+ query2

  • 0

$.getJSON('http://twitter.com/followers/ids.json?screen_name=/…'+ query1 + '&callback=?',
  function(data) {
    alert('JSON data string 1 is: '+data); 
    $.getJSON('http://twitter.com/followers/ids.json?screen_name=/…'+ query2 + '&callback=?', 
      function(data1) {
        alert('JSON data string 2 is: '+data1); 
        f2=data1; 
        f1=data; 
        for(var i=0; i "less than" f1.length; i++)
        {
          for(var j=0; j "less than" f2.length; i++)
          {
            if (f1[i] == f2[j])
            {
              common[c]=f1[i];
              c+=1;
            }
          }
        }
        $('#content').append(''+common.length+'');//this line is not working though....... 
    });
});

In this piece of the line

$('#content').append(''+common.length+'');

doesnt show the output actually it the page hangs

Any help will be appreciated.

Thank You

  • 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-12T05:07:39+00:00Added an answer on May 12, 2026 at 5:07 am

    Don’t nest the calls. You also avoid some memory issues where javascript maintains a copy of all local variables for every anonymous function. By making the two calls separately you can also perform both calls at once instead of sequentially.

    This is a better method if I understand your purpose. Plus by polling gotA and gotB you can even make a nice little “waiting for A, waiting for B” notification for users.

    Edit: Added for loop fix from previous answer.

    var gotA, gotB;
    var followingA, followingB;
    function getCommonFollowers(user1, user2)
    {
        gotA = false;
        gotB = false;
        jQuery.getJSON('http://twitter.com/followers/ids.json?screen_name=/…'+ user1 + '&callback=?', gotFollowersOfA );
        jQuery.getJSON('http://twitter.com/followers/ids.json?screen_name=/…'+ user2 + '&callback=?', gotFollowerOfB );
    }
    function gotFollowersOfA(data)
    {
        followingA = data;
        gotA = true;
        if (gotB) {
            compareFollowersAB();
        }
    }
    function gotFollowersOfB(data)
    {
        followingB = data;
        gotB = true;
        if (gotA) {
            compareFollowersAB();
        }
    }
    function compareFollowersAB()
    {
        f2=followingA; 
        f1=followingB; 
        for(var i=0; i < f1.length; i++) {
            for(var j=0; j < f2.length; j++) {
                if (f1[i] == f2[j]) {
                    //console.log("Adding f1[i]");
                    common.push(f1[i]);
                }
            }
        }
        $('#content').append(''+common.length+'');
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

$.getJSON('http://twitter.com/followers/ids.json?screen_name=' + query1 + '&callback=?', function (data) { console.log('JSON data string 1 is: '
Example code var jqxhr=$.getJSON(http://search.twitter.com/search.json?callback=?,{q:query}, function(data) { ... question. }); Question Now i need to
$(function(){ $.getJSON('http://pipes.yahoo.com/pipes/pipe.run?_id=7ba696f34ae17b6fa8f5d4de13064dea&_render=json&callback=?',function(data){alert('called')}); }); i am using the above code to acess the a yahoo
$(function(){ $.getJSON('http://ws.audioscrobbler.com/2.0/?method=user.getweeklyartistchart&user=ElicitBelief&api_key=25135a535781328243f9e31968abc14&format=json', function(data) { alert(data) }); }); Firebug says: GET http://ws.audioscrobbler.com/2.0/?method=user.getweeklyartistchart&user=ElicitBelief&api_key=25135a535781328243f9e31968abc14&format=json 200 OK 144ms
Using this code $.getJSON(http://mydomain.com/getcustomers?callback=?,function(data) { .... }).error(function(err){ .... }) I'm getting jQuery16103492487950357067_1336742910384 was not
function load_result() { $.getJSON( http://somesite.com/loadresult.php, function(data) { if( data == undefined || data ==
I call $.getJSON('http://localhost:8000/polls/?callback=?', function(data) and recieve an error: Error: parsererror errorThrown: jQuery16103397698865741826_1320825997345 was not
$.getJSON(/data/data/com.android.tcptest/files/BPL.json, function(data) { var i = 0, dataSize = data.length, tmpArray = []; for(i;
String.prototype.getLanguage = function() { $.getJSON('http://ajax.googleapis.com/ajax/services/language/detect?v=1.0&q=' + this + '&callback=?', function(json) { return json.responseData.language; });
$.getJSON('https://graph.facebook.com/BogdanErimia/posts/?access_token=xxxxx&date_format=U&limit=17&callback=?', function(feed) { $.each(feed.data, function(index, item){ $('.tweet').append('<div class=item-normal><div class=normal><div id=story2>' + item.message + '</div></div><div

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.