User:Aanok/common.js

/* // FUNCTIONS AND GLOBALS var content = null;

function loadXMLDoc(theURL) {   if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari, SeaMonkey xmlhttp = new XMLHttpRequest; }   else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }   xmlhttp.onreadystatechange = function { // Called when the GET is answered if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var parser = new DOMParser; var doc = parser.parseFromString(xmlhttp.responseText, "text/html"); content = doc.getElementById("munycontent").innerHTML; }   };    xmlhttp.open("GET", theURL, false); // true means done asynchronously xmlhttp.send; }

// SCRIPT $(window).load(function{   // Called after the entire page (DOM + images + iframes) is loaded, so after makeSidebar has run    loadXMLDoc('http://fort-muny.wikia.com/wiki/Sidebar_Navigation?action=raw');        if (content !== null) {            $('.WikiaActivityModule').after(content);        }    });