Open main menu

Changes

MediaWiki:Common.js

1,055 bytes added, 20:31, 22 February 2008
no edit summary
return str;
}
 
/** Calendar extension ***/
function makeRequest(url) {
var httpRequest;
if (window.XMLHttpRequest) { // Mozilla, Safari, ...
httpRequest = new XMLHttpRequest();
} else if (window.ActiveXObject) { // IE
try {
httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!httpRequest) {
alert("Giving up :( Cannot create an XMLHTTP instance");
return false;
}
httpRequest.onreadystatechange = function() { alertContents(httpRequest); };
httpRequest.open("GET", url, true);
httpRequest.send(null);
}
function alertContents(httpRequest) {
if (httpRequest.readyState == 4) {
if (httpRequest.status == 200) {
document.getElementById("p-calendar").innerHTML = httpRequest.responseText;
} else {
document.getElementById("p-calendar").innerHTML = "<p>There was a problem with the request.</p>";
}
}
}