"+ "
"+ ""+ title+ ""+ "
"+ "
Views : "+ displayedView+ " |
"+ "
"+ ""+ " "+ " "+ " "+ " "+ " "+ ""+ "
"+ "
"+ "
"+""+ ""+ "
"+ "
"+ "
"+ ""+ title+ ""+ "
"+ "
Views : "+ displayedView+ " |
"+ "
"+ ""+ " "+ " "+ " "+ " "+ " "+ "" + "
"+ "
"+ "
"+"
" +"
"+"
"+"
"+"
" +"
" +"
" +"
"+ "
"+ "
";} if( articleHolder != ""){$('#topViewedArticlesHolder').append(articleHolder); counterUpcoming++ ; } if($(window).width() < 767){ if((counterUpcoming % 2) == 0){ var adDivsUpcoming = "
" ; try { (adsbygoogle = window.adsbygoogle || []).push({}); }catch(err){ console.log("Error Occurred in upcoming 2="+ err.message); } $('#topViewedArticlesHolder').append(adDivsUpcoming); } }else { if((counterUpcoming % 3) == 0){ var adDivsUpcoming = "
" ; try { (adsbygoogle = window.adsbygoogle || []).push({}); }catch(err){ console.log("Error Occurred in upcoming="+ err.message); } $('#topViewedArticlesHolder').append(adDivsUpcoming); } }//Coloring the stars based on ratingfor (var i = 1; i <= rating; i++) {$('#topviewedspan' + articleId + ' #'+ i + '').css({'background-position' : '0 0'});}}function setTopViewedArticles(lastArt) {if(lastArt == ""){ }else{ $('#loader_second_coloumn').css({"display":"block"});var pageSize = $('#pageSize_topViewedStories').val();var data = '&pageSize=' + pageSize + '&topic=' + topic + '&lastArticleUpcoming=' +lastArt+'';$.ajax({type : 'POST',async : false, url : '/rest/cms/post/fetchTopViewedArticlesByPageSize?',data : data,success : function(jsonResp) { //console.log("jsonResp in upcoming--"+jsonResp)if(jsonResp == "No Articles"){lastArticleUpcoming = "";}else{ var articles = eval('(' + jsonResp + ')'); $.each(articles, function(i, article) {var articleId = article.id;var title = article.title;var summary = article.summary;var story = article.story.value;var category = article.category;var subCategory = article.subCategory;var date = article.date;var author = article.author;var blobKey = article.blobKey;var views = article.views;var rating = article.rating;var created = article.created;var article_topic = article.topic;var imageURL = article.imageURL;if (views == "undefined") {views = "0";}if (rating == "undefined") {rating = "0";} createTopViewedArticle(articleId, title, summary,story, category, subCategory, date, author,imageURL, views, rating, created, article_topic);lastArticleUpcoming=created; });}},complete: function(){$('#loader_second_coloumn').css({"display":"none"}); }});}}