I have a jQuery code block for a twitter widget i'm developing ,
$.getJSON("http://twitter.com/users/show.json?screen_name=" + twitterfeed + "&callback=?" ,
function(data) {
var fString = ($('<div id="userimage"><h1>'+ data.followers_count +'</h1></div>').digits()).text();
var tString = ($('<div id="userimage"><h1>'+ data.statuses_count +'</h1></div>').digits()).text();
$('#left-sidebar').prepend('<div id="userimage"><h1>'+ tString +'</h1></div>');
$('#left-sidebar').prepend('<div id="userimage"><h2>TWEETS</h2></div>');
$('#left-sidebar').prepend('<div id="userimage"><h1>'+ fString +'</h1></div>');
$('#left-sidebar').prepend('<div id="userimage"><h2>FOLLOWERS</h2></div>');
$('#left-sidebar').prepend('<div id="userimage"><img id="ProfileImageLarge" src=' + data.profile_image_url + '></div>');
});
I want to grab fString
and tString
and use them in outside functions.
I also need the value of data.followers_count
and data.statuses_count
to be passed along with the variable so that value is correct in any function instead of undefined.