MediaWiki:Common.js

var Stats; function FetchBF3Stats { var BF3Stats = document.getElementById('BF3Stats'); var Player = BF3Stats.dataset.player; var Platform = BF3Stats.dataset.platform; $('#BF3Stats').html('Loading stats. '); $.ajax({		type: 'POST',		url: 'http://api.bf3stats.com/' + Platform + '/player/',		data: { 			'player': Player, 			'opt': 'rank'		},		success: function(data){			Stats = JSON.parse(data);			BuildStatTable;		}	}); }

function BuildStatTable { var html = ' Stats generated by bf3stats.com '; $('#BF3Stats').html(html); }

function AddStat(stat, value) { return ' ' + stat + '  ' + value  + '  '; }	$(document).ready(function {	if ((mw.config.get('wgCanonicalNamespace') == 'User') && ($('#BF3Stats').length > 0)) {		FetchBF3Stats	} });