User:Jgjake2/global.js

var rootdomain = "http://elderscrolls.wikia.com/index.php?title=" var urlsuffex = "&action=render"; var ajaxContainerId = "ajaxContentArea"; var ajaxLoadingIcon = "http://images4.wikia.nocookie.net/elderscrolls/images/f/f3/AjaxLoading.gif"; var ajaxLoadingIconId ="#ajaxLoadingIcon";

var apiRootdomain = "http://elderscrolls.wikia.com/api.php?action=parse&text="; var apiUrlsuffex = "&format=xml";

function addAjaxXmlLinks{ var $ajaxDivs = $(".ajaxXmlLink"); $ajaxDivs.each( function(i) {       var ajaxDiv_Link = $(this).children("a")[0];        var tURL = $ajaxDivs[i].id;		tURL = tURL.replace('\.2F','/').replace('\.27','\'').replace('\.28','(').replace('\.29',')');		var highlightNumber = $ajaxDivs[i].title;		var tmpText = "";		var newurl = apiRootdomain + tmpText + apiUrlsuffex;        //ajaxDiv_Link.setAttribute('href', "javascript:ajaxpage('" + tURL + "', '" + ajaxContainerId + "');");		ajaxDiv_Link.setAttribute('href', "javascript:renderAjaxXmlPage('" + newurl + "', '" + ajaxContainerId + "');");    } ); $(ajaxLoadingIconId).css({'z-index' : '99', 'position' : 'relative', 'top' : '0px', 'left' : '0px', 'width' : '100%', 'height' : '200px'}); $(ajaxLoadingIconId).html(' '); $('#' + ajaxContainerId).ajaxStart(function {       $(ajaxLoadingIconId).show;    }).ajaxComplete(function {        $(ajaxLoadingIconId).hide;        //makePopupBalloonsById(ajaxContainerId);    });

}

function renderAjaxXmlPage(turl, container) { $('#' + container).html(''); $.ajax({			type: "GET",		url: turl,		dataType: "xml",		success: function(xml) {			//alert($(xml).find("text").text);			$('#' + container).html($(xml).find("text").text);			makePopupBalloonsById(container);		}	}); } addOnloadHook(addAjaxXmlLinks); //http://elderscrolls.wikia.com/api.php?action=parse&text=&format=xml