User:Gauransh Dingwani/common.js

mw.loader.using( 'mw.Api' ).then( function {  // Call to the function that uses mw.Api  var api = new mw.Api; api.get( { action: 'query', prop: 'pageviews', titles: [mw.config.get('wgPageName'),] } ).done( function ( data ) { console.log( data ); console.log(mw.config.get('wgArticleId')); } ); } );