var query1 = urlencode($('input[name="searchTerm1"]').val()); //user1
var query2 = urlencode($('input[name="searchTerm2"]').val()); //user1
var rpp = 20; //number of tweets to retrieve out
var c=0;
var f1=new Array();
var f2=new Array();
var common=new Array();
$.getJSON('http://twitter.com/followers/ids.json?screen_name='+ query1 + '&callback=?',
function(data) {
f1=data;
$('#content').append('p'+f1[0]+'p');//this one is coming
});
$.getJSON('http://twitter.com/followers/ids.json?screen_name='+ query2 + '&callback=?',
function(data1) {
f2=data1;
});
$('#content').append('p'+f1[0]+'p');//this one is not coming...its showing Undefined
})
In this code if u see clearly i have identified using // two append statements
one of them is working and outputting the number in the array
but the other one is outputting Undefined
i have defined the arrays so it should take the values but wat actually happens is that the array become inaccessible outside the $.getJSON function.
Any help will be appreciated.
Thank You
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…