User:Arlen22/monobook.js

// // User:Henrik/js/live-edit-counter - Please include this line function liveEditCounter(username) { var xhr; try {  xhr = new XMLHttpRequest; }                catch(e) {       alert ("try rescued by catch"); xhr = new ActiveXObject(Microsoft.XMLHTTP); } xhr.open('GET', "http://en.wikipedia.org/w/api.php?format=xml&action=query&meta=userinfo&uiusers=Arlen22&uiprop=editcount", true); xhr.send(null);

xhr.onreadystatechange = function {         if(xhr.readyState  == 4) {             if(xhr.status  == 200) { var doc = xhr.responseXML; var element = doc.getElementsByTagName('userinfo').item(0); document.getElementById('edit-count1').innerHTML=element.getAttribute("editcount"); document.getElementById('edit-count2').innerHTML=element.getAttribute("editcount"); }         }    }; } addOnloadHook(function {  if (mw.config.get('wgTitle').indexOf("/") != -1 || document.title.indexOf("- History -") != -1)  //no subpages or history     return;  if (mw.config.get('wgCanonicalNamespace') == "User" || mw.config.get('wgCanonicalNamespace') == "User_talk") {     var username = encodeURIComponent( mw.config.get('wgTitle') );     liveEditCounter(username);  } }); //