User:DanielPenfield/gadgets/example.js

/*if ((mw.config.get('wgAction') == 'edit') && (mw.config.get('wgNamespaceNumber') == 1)) {	var articleContent = "EMPTY"; var url = "NONE"; var pageViewsContent = "EMPTY"; try {		url = mw.config.get('wgScript') + '?action=raw&ctype=application/json&maxage=86400&title=' + mw.config.get('wgTitle'); alert(url); $.ajax(			{				'url': url,				'async': false,				'success': function (data)				{					articleContent = data;				},				'error': function (xhr, message)				{					throw new Error(message);				}			}		); }	catch (e) {		alert('Error retrieving "' + url + '" exception: ' + e.message + '.'); }	try {		url = 'http://stats.grok.se/en/latest90/' + mw.config.get('wgTitle').replace(/ /g, '_'); $.ajax(			{				'url': url,				'async': false,				'success': function (data)				{					pageViewsContent = data;				},				'error': function (xhr, message)				{					throw new Error(message);				}			}		); }	catch (e) {		console.warn('Error retrieving "' + url + '" exception: ' + e.message + '.'); } }