1
- var subscriberCount = [ ] , viewCount = [ ] , commentCount = [ ] , videoCount = [ ] ;
1
+ var channelSubscriberCount = [ ] , channelViewCount = [ ] , channelCommentCount = [ ] , channelVideoCount = [ ] ;
2
2
3
3
function getNewChannel ( ) {
4
4
document . getElementById ( 'display' ) . innerHTML = '' ;
@@ -24,23 +24,23 @@ function channelsCountCode(channelId , i=0){
24
24
async :false ,
25
25
success : function ( data ) {
26
26
var temp = data . items [ 0 ] ;
27
- subscriberCount [ i ] = temp . statistics . subscriberCount ;
28
- viewCount [ i ] = temp . statistics . viewCount ;
29
- commentCount [ i ] = temp . statistics . commentCount ;
30
- videoCount [ i ] = temp . statistics . videoCount ;
27
+ channelSubscriberCount [ i ] = temp . statistics . subscriberCount ;
28
+ channelViewCount [ i ] = temp . statistics . viewCount ;
29
+ channelCommentCount [ i ] = temp . statistics . commentCount ;
30
+ channelVideoCount [ i ] = temp . statistics . videoCount ;
31
31
}
32
32
} ) ;
33
33
}
34
34
35
- function displayChannelsCount ( i ) {
35
+ function displayChannelsCount ( i = 0 ) {
36
36
$ ( '#display' ) . append ( '\
37
37
<div id="channel' + channelId [ i ] + '">\
38
38
<img src="' + channelThumbnail [ i ] + '">\
39
39
<h1 id="' + channelTitle [ i ] + '" onClick="getNewChannel()">' + channelTitle [ i ] + '</h1>\
40
- <h2 id="' + channelId [ i ] + '">Subscribers : ' + subscriberCount [ i ] + '</h2>\
41
- <h2 id="' + channelId [ i ] + '">Channel Views: ' + viewCount [ i ] + '</h2>\
42
- <h2 id="' + channelId [ i ] + '">Videos : ' + videoCount [ i ] + '</h2>\
43
- <h2 id="' + channelId [ i ] + '">Comments : ' + commentCount [ i ] + '</h2>\
40
+ <h2 id="' + channelId [ i ] + 'subscribers ">Subscribers : ' + channelSubscriberCount [ i ] + '</h2>\
41
+ <h2 id="' + channelId [ i ] + 'views ">Channel Views: ' + channelViewCount [ i ] + '</h2>\
42
+ <h2 id="' + channelId [ i ] + 'videos ">Videos : ' + channelVideoCount [ i ] + '</h2>\
43
+ <h2 id="' + channelId [ i ] + 'comments ">Comments : ' + channelCommentCount [ i ] + '</h2>\
44
44
</div>\
45
45
' ) ;
46
46
}
0 commit comments