correctly scope locals
Brandon Mathis authored on 04/08/2011 at 23:03:21... | ... |
@@ -1,13 +1,15 @@ |
1 | 1 |
// JSON-P Twitter fetcher for Octopress |
2 | 2 |
// (c) Brandon Mathis // MIT Lisence |
3 | 3 |
function getTwitterFeed(user, count, replies) { |
4 |
- feed = new jXHR(); |
|
4 |
+ var feed = new jXHR(); |
|
5 |
+ |
|
5 | 6 |
feed.onerror = function (msg,url) { |
6 | 7 |
$('#tweets li.loading').addClass('error').text("Twitter's busted"); |
7 | 8 |
} |
8 | 9 |
feed.onreadystatechange = function(data){ |
9 | 10 |
if (feed.readyState === 4) { |
10 | 11 |
var tweets = new Array(); |
12 |
+ var i = 0; |
|
11 | 13 |
for (i in data){ |
12 | 14 |
if(tweets.length < count){ |
13 | 15 |
if(replies || data[i].in_reply_to_user_id == null){ |