User:Nithingautham/common.js

var gapi=new mw.Api; api.get( {   action: 'parse',    prop: 'categories',    page: 'India' } ) .done( function ( data ) { $.each(data.parse.categories,function{

console.log(this["*"]);

});

} ) .fail( function ( error ) { console.log( 'API failed ', error ); } ); $(document).ready( function {

if(document.URL.indexOf('edit') == -1) { mw.util.jsMessage("this is not an edit page");

} } );