User:Shizhao/common.js

var i=0; var title=[]; //var count=[]; var api = new mw.Api; api.get( {	format: 'json',	action: 'query',	list: 'mostviewed',	pvimlimit: 50 } ).done( function ( data ) {	$.each( data.query.mostviewed, function(n, item) { if (item.ns===0 && i< 10){ title[i]=''+item.title+''; //count[i]=item.count; i=i+1; }		});	toptitles=title.join('');	//mw.Api.plugin.parse( toptitles )	//	.done( function ( html ) { //		console.log( 'Parsed result:', html ); $("div#uptrends").append(''+toptitles+''); //	} );			} ); /* Add some HTML to the page content */ //$("div#uptrends").append(" Lorem ipsum This section was just added to the bottom of the wiki page. ");