User:Jonas Lund/temptemp
< User:Jonas Lund
Revision as of 15:17, 13 December 2011 by Jonas Lund (talk | contribs) (Created page with "<source lang="javascript"> //Xhr Request function getTraceRouteCount(callback) { var currentUrl = window.location.href; var xhr = new XMLHttpRequest(); xhr.onreadystatechan...")
//Xhr Request
function getTraceRouteCount(callback) {
var currentUrl = window.location.href;
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function(data) {
if (xhr.readyState == 4) {
if (xhr.status == 200) {
var data = xhr.responseText;
callback(data);
} else {
callback(null);
}
}
}
// Note that any URL fetched here must be matched by a permission in
// the manifest.json file!
var url = "http://pzwart3.wdka.hro.nl/~egreenhalgh/hopsToPercent2.py?url="+ currenUrl;
xhr.open('GET', url, true);
xhr.send();
};
//Change body opacity
function opacityTrickery(data) {
$("body").css({opacity: data});
}
//Start Functions
getTraceRouteCount(opacityTrickery);